add RageFile::PutLine
This commit is contained in:
@@ -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() )
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user