add RageFile::PutLine

This commit is contained in:
Glenn Maynard
2003-12-04 04:26:49 +00:00
parent 51401ea747
commit d5bc752e9d
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -125,6 +125,19 @@ void RageFile::GetLine( CString &out )
}
}
#if defined(_WIN32)
#define NEWLINE "\r\n"
#else
#define NEWLINE "\n"
#endif
int RageFile::PutLine( const CString &str )
{
if( Write(str.data(), str.size()) == -1 )
return -1;
return Write( NEWLINE, strlen(NEWLINE) );
}
int RageFile::Read( void *buffer, size_t bytes )
{
if( !IsOpen() )
+1
View File
@@ -57,6 +57,7 @@ public:
bool PutString(const CString& string) { return fputs(string, mFP) >= 0; }
int Read(void *buffer, size_t bytes);
int Write(const void *buffer, size_t bytes);
int PutLine( const CString &str );
/* Line-based I/O: */
CString GetLine();