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
+19 -19
View File
@@ -16,18 +16,18 @@
const int MAX_EDIT_COURSE_SIZE_BYTES = 30*1024; // 30KB
bool CourseLoaderCRS::LoadFromBuffer( const CString &sPath, const CString &sBuffer, Course &out )
bool CourseLoaderCRS::LoadFromBuffer( const RString &sPath, const RString &sBuffer, Course &out )
{
MsdFile msd;
msd.ReadFromString( sBuffer );
return LoadFromMsd( sPath, msd, out, true );
}
bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Course &out, bool bFromCache )
bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Course &out, bool bFromCache )
{
const CString sFName = SetExtension( out.m_sPath, "" );
const RString sFName = SetExtension( out.m_sPath, "" );
vector<CString> arrayPossibleBanners;
vector<RString> arrayPossibleBanners;
GetDirListing( sFName + "*.png", arrayPossibleBanners, false, true );
GetDirListing( sFName + "*.jpg", arrayPossibleBanners, false, true );
GetDirListing( sFName + "*.bmp", arrayPossibleBanners, false, true );
@@ -39,7 +39,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
float fGainSeconds = 0;
for( unsigned i=0; i<msd.GetNumValues(); i++ )
{
CString sValueName = msd.GetParam(i, 0);
RString sValueName = msd.GetParam(i, 0);
const MsdFile::value_t &sParams = msd.GetValue(i);
// handle the data
@@ -49,7 +49,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
out.m_sMainTitleTranslit = sParams[1];
else if( 0 == stricmp(sValueName, "REPEAT") )
{
CString str = sParams[1];
RString str = sParams[1];
str.MakeLower();
if( str.find("yes") != string::npos )
out.m_bRepeat = true;
@@ -86,7 +86,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
float end = -9999;
for( unsigned j = 1; j < sParams.params.size(); ++j )
{
vector<CString> sBits;
vector<RString> sBits;
split( sParams[j], "=", sBits, false );
if( sBits.size() < 2 )
continue;
@@ -147,9 +147,9 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
else if( sParams[1].Right(1) == "*" )
{
//new_entry.bSecret = true;
CString sSong = sParams[1];
RString sSong = sParams[1];
sSong.Replace( "\\", "/" );
vector<CString> bits;
vector<RString> bits;
split( sSong, "/", bits );
if( bits.size() == 2 )
{
@@ -174,7 +174,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
}
else
{
CString sSong = sParams[1];
RString sSong = sParams[1];
new_entry.pSong = SONGMAN->FindSong( sSong );
if( new_entry.pSong == NULL )
@@ -206,11 +206,11 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
{
/* If "showcourse" or "noshowcourse" is in the list, force new_entry.secret
* on or off. */
vector<CString> mods;
vector<RString> mods;
split( sParams[3], ",", mods, true );
for( int j = (int) mods.size()-1; j >= 0 ; --j )
{
CString &sMod = mods[j];
RString &sMod = mods[j];
TrimLeft( sMod );
TrimRight( sMod );
if( !sMod.CompareNoCase("showcourse") )
@@ -268,9 +268,9 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou
return true;
}
bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out )
bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out )
{
CString sPath = _sPath;
RString sPath = _sPath;
out.Init();
@@ -278,7 +278,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out )
// save group name
{
vector<CString> parts;
vector<RString> parts;
split( sPath, "/", parts, false );
if( parts.size() >= 4 ) // e.g. "/Courses/blah/fun.cvs"
out.m_sGroupName = parts[parts.size()-2];
@@ -301,7 +301,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out )
if( bUseCache )
{
CString sCacheFile = out.GetCacheFilePath();
RString sCacheFile = out.GetCacheFilePath();
LOG->Trace( "CourseLoaderCRS::LoadFromCRSFile(\"%s\") (\"%s\")", sPath.c_str(), sCacheFile.c_str() );
sPath = sCacheFile.c_str();
}
@@ -322,7 +322,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out )
/* If we have any cache data, write the cache file. */
if( out.m_RadarCache.size() )
{
CString sCachePath = out.GetCacheFilePath();
RString sCachePath = out.GetCacheFilePath();
CourseWriterCRS::Write( out, sCachePath, true );
SONGINDEX->AddCacheIndex( out.m_sPath, GetHashForFile(out.m_sPath) );
@@ -332,7 +332,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out )
return true;
}
bool CourseLoaderCRS::LoadEdit( const CString &sEditFilePath, ProfileSlot slot )
bool CourseLoaderCRS::LoadEdit( const RString &sEditFilePath, ProfileSlot slot )
{
LOG->Trace( "CourseLoaderCRS::LoadEdit(%s)", sEditFilePath.c_str() );
@@ -358,7 +358,7 @@ bool CourseLoaderCRS::LoadEdit( const CString &sEditFilePath, ProfileSlot slot )
return true;
}
bool CourseLoaderCRS::LoadEditFromBuffer( const CString &sBuffer, const CString &sPath, ProfileSlot slot )
bool CourseLoaderCRS::LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot )
{
Course *pCourse = new Course;
if( !LoadFromBuffer(sPath, sBuffer, *pCourse) )