CString -> RString

This commit is contained in:
Chris Danford
2006-01-22 01:00:06 +00:00
parent 870ed267fc
commit 7f821e8cfc
578 changed files with 3943 additions and 3946 deletions
+16 -16
View File
@@ -17,7 +17,7 @@ void CreateBinaryTestFile( RageFile &f, int size )
}
}
void CreateBinaryTestFile( CString fn, int size )
void CreateBinaryTestFile( RString fn, int size )
{
RageFile f;
f.Open( fn, RageFile::WRITE );
@@ -36,7 +36,7 @@ void CreateBinaryTestFile( CString fn, int size )
}
bool CheckData( const CString &buf, int offset )
bool CheckData( const RString &buf, int offset )
{
char c = offset%256;
@@ -62,7 +62,7 @@ int TestBinaryRead( RageFile &test, int size, bool AllowEOF, int ExpectedFilePos
return -1;
}
if( !CheckData( CString(buf, ret), TestDataPos ) )
if( !CheckData( RString(buf, ret), TestDataPos ) )
{
LOG->Warn("TestBinaryRead: check failed (size %i, %i,%i)",
size, ExpectedFilePos, TestDataPos );
@@ -77,14 +77,14 @@ int TestBinaryRead( RageFile &test, int size, bool AllowEOF, int ExpectedFilePos
return 1;
}
CString MakeTextTestLine( int line, int size )
RString MakeTextTestLine( int line, int size )
{
CString ret = ssprintf( "%02i", line );
ret.append( CString( size-ret.size(), 'x' ) );
RString ret = ssprintf( "%02i", line );
ret.append( RString( size-ret.size(), 'x' ) );
return ret;
}
bool CheckTextData( const CString &buf, int LineSize, int size )
bool CheckTextData( const RString &buf, int LineSize, int size )
{
return buf == MakeTextTestLine( LineSize, size );
}
@@ -93,7 +93,7 @@ void TestText( int LineSize, bool DOS )
{
const unsigned NumLines = 50;
CString filename = "test.text";
RString filename = "test.text";
if( DOS )
filename += ".DOS";
filename += ssprintf( ".%i", LineSize );
@@ -104,7 +104,7 @@ void TestText( int LineSize, bool DOS )
for( unsigned line = 0; line < NumLines; ++line )
{
const CString TestLine = MakeTextTestLine( line, LineSize );
const RString TestLine = MakeTextTestLine( line, LineSize );
f.Write( TestLine );
if( DOS )
f.Write( "\r" );
@@ -130,7 +130,7 @@ void TestText( int LineSize, bool DOS )
int ExpectedPos = 0;
for( unsigned line = 0; line < NumLines; ++line )
{
CString buf;
RString buf;
if( test.GetLine( buf ) <= 0 )
{
LOG->Warn("Text read failure, line %i, size %i, DOS %i",
@@ -171,7 +171,7 @@ void TestText( int LineSize, bool DOS )
TestBinaryRead( test, 1024, true, test.Tell(), 1024*3 );
{
CString buf;
RString buf;
if( test.GetLine( buf ) <= 0 )
{
LOG->Warn( "Unexpected EOF in final line read, DOS %i", DOS );
@@ -192,7 +192,7 @@ void TestText( int LineSize, bool DOS )
}
{
CString buf;
RString buf;
if( test.GetLine( buf ) != 0 )
{
LOG->Warn( "Expected EOF in final text read, but didn't get it" );
@@ -234,11 +234,11 @@ void TestText()
void TestSeek( bool relative )
{
const CString TestLine = "Hello World\n";
const RString TestLine = "Hello World\n";
/* Print a couple kb of text. Make sure this is big enough that the binary
* test data after it won't start in the buffer; if that happens, the seek
* will be optimized out. */
CString junk;
RString junk;
for( int lines = 0; lines < 128; ++lines )
junk += "XXXXXXXXX\n";
@@ -258,7 +258,7 @@ void TestSeek( bool relative )
* read into the buffer. */
RageFile test;
test.Open("test.seek");
CString line;
RString line;
test.GetLine( line );
/* Run the absolute seek test twice. */
@@ -332,7 +332,7 @@ void CheckDeflate( RageFileObjMem &data, int iSize, unsigned iInputCRC, int iBlo
{
data.Seek(0);
CString foo2;
RString foo2;
RageFileObjInflate infl( &data, iSize );
infl.EnableCRC32();