diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 79776e2f1f..2f334067a4 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -56,7 +56,7 @@ retry: RageFileManager::FileType ft = FILEMAN->GetFileType( sPath ); if( ft != RageFileManager::TYPE_FILE && ft != RageFileManager::TYPE_DIR ) { - CStringArray asPaths; + vector asPaths; GetDirListing( sPath + "*", asPaths, false, true ); // return path too if( asPaths.empty() ) diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 6a018e954d..93cba99661 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -15,7 +15,7 @@ AnnouncerManager::AnnouncerManager() LOG->Trace("AnnouncerManager::AnnouncerManager()"); } -void AnnouncerManager::GetAnnouncerNames( CStringArray& AddTo ) +void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) { GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true ); @@ -32,7 +32,7 @@ bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) if( sAnnouncerName == "" ) return true; - CStringArray asAnnouncerNames; + vector asAnnouncerNames; GetAnnouncerNames( asAnnouncerNames ); for( unsigned i=0; i as; GetAnnouncerNames( as ); if( as.size()==0 ) return; diff --git a/stepmania/src/AnnouncerManager.h b/stepmania/src/AnnouncerManager.h index 732afd2f24..4e7ed976c8 100644 --- a/stepmania/src/AnnouncerManager.h +++ b/stepmania/src/AnnouncerManager.h @@ -6,7 +6,7 @@ class AnnouncerManager public: AnnouncerManager(); - void GetAnnouncerNames( CStringArray& AddTo ); + void GetAnnouncerNames( vector& AddTo ); bool DoesAnnouncerExist( CString sAnnouncerName ); void SwitchAnnouncer( CString sNewAnnouncerName ); CString GetCurAnnouncerName() { return m_sCurAnnouncerName; }; diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index b52ee68ced..8efa4b50db 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -123,7 +123,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir ) // This is an old style BGAnimation (not using .ini) // loading a directory of layers - CStringArray asImagePaths; + vector asImagePaths; ASSERT( sAniDir != "" ); GetDirListing( sAniDir+"*.png", asImagePaths, false, true ); diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 1a8ba02163..2add9b8c6e 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -324,7 +324,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun // - song's dir // - RandomMovies dir // - BGAnimations dir. - CStringArray vsPaths, vsThrowAway; + vector vsPaths, vsThrowAway; // Look for BGAnims in the song dir if( sToResolve == SONG_BACKGROUND_FILE ) @@ -507,7 +507,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // Choose a bunch of background that we'll use for the random file marker // { - CStringArray vsThrowAway, vsNames; + vector vsThrowAway, vsNames; switch( PREFSMAN->m_RandomBackgroundMode ) { default: diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 6449058f1a..63c3cf093a 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -372,12 +372,12 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText, /* It doesn't. I can add Japanese wrapping, at least. We could handle hyphens * and soft hyphens and pretty easily, too. -glenn */ // TODO: Move this wrapping logic into Font - CStringArray asLines; + vector asLines; split( m_sText, "\n", asLines, false ); for( unsigned line = 0; line < asLines.size(); ++line ) { - CStringArray asWords; + vector asWords; split( asLines[line], " ", asWords ); CString sCurLine; diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index ecd9c6e5a0..0a21831d59 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -25,7 +25,7 @@ bool Character::Load( CString sCharDir ) } { - CStringArray as; + vector as; GetDirListing( m_sCharDir+"card.png", as, false, true ); GetDirListing( m_sCharDir+"card.jpg", as, false, true ); GetDirListing( m_sCharDir+"card.gif", as, false, true ); @@ -37,7 +37,7 @@ bool Character::Load( CString sCharDir ) } { - CStringArray as; + vector as; GetDirListing( m_sCharDir+"icon.png", as, false, true ); GetDirListing( m_sCharDir+"icon.jpg", as, false, true ); GetDirListing( m_sCharDir+"icon.gif", as, false, true ); @@ -67,7 +67,7 @@ bool Character::Load( CString sCharDir ) CString GetRandomFileInDir( CString sDir ) { - CStringArray asFiles; + vector asFiles; GetDirListing( sDir, asFiles, false, true ); if( asFiles.empty() ) return CString(); @@ -90,7 +90,7 @@ CString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomF CString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance/")); } CString Character::GetTakingABreakPath() const { - CStringArray as; + vector as; GetDirListing( m_sCharDir+"break.png", as, false, true ); GetDirListing( m_sCharDir+"break.jpg", as, false, true ); GetDirListing( m_sCharDir+"break.gif", as, false, true ); @@ -103,7 +103,7 @@ CString Character::GetTakingABreakPath() const CString Character::GetSongSelectIconPath() const { - CStringArray as; + vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"selectmusicicon.png", as, false, true ); @@ -129,7 +129,7 @@ CString Character::GetSongSelectIconPath() const CString Character::GetStageIconPath() const { - CStringArray as; + vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"stageicon.png", as, false, true ); diff --git a/stepmania/src/CharacterManager.cpp b/stepmania/src/CharacterManager.cpp index 80824c5a93..7b16e68d27 100644 --- a/stepmania/src/CharacterManager.cpp +++ b/stepmania/src/CharacterManager.cpp @@ -14,7 +14,7 @@ CharacterManager::CharacterManager() SAFE_DELETE( m_pCharacters[i] ); m_pCharacters.clear(); - CStringArray as; + vector as; GetDirListing( CHARACTERS_DIR "*", as, true, true ); StripCvs( as ); diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index cb20e8799b..caae543518 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -96,7 +96,7 @@ bool CodeItem::Load( CString sButtonsNames ) buttons.clear(); const Game* pGame = GAMESTATE->GetCurrentGame(); - CStringArray asButtonNames; + vector asButtonNames; bool bHasAPlus = sButtonsNames.Find( '+' ) != -1; bool bHasADash = sButtonsNames.Find( '-' ) != -1; diff --git a/stepmania/src/Command.cpp b/stepmania/src/Command.cpp index 992613a900..1512365ac7 100644 --- a/stepmania/src/Command.cpp +++ b/stepmania/src/Command.cpp @@ -126,7 +126,7 @@ CString Commands::GetOriginalCommandString() const void ParseCommands( const CString &sCommands, Commands &vCommandsOut ) { - CStringArray vsCommands; + vector vsCommands; SplitWithQuotes( sCommands, ';', vsCommands, true ); // do ignore empty vCommandsOut.v.resize( vsCommands.size() ); diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index 5a6b609de1..7b427faf1b 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -37,7 +37,7 @@ void ThemeMetricDifficultiesToShow::Read() m_v.clear(); - CStringArray v; + vector v; split( ThemeMetric::GetValue(), ",", v ); ASSERT( v.size() > 0 ); @@ -67,7 +67,7 @@ void ThemeMetricCourseDifficultiesToShow::Read() m_v.clear(); - CStringArray v; + vector v; split( ThemeMetric::GetValue(), ",", v ); ASSERT( v.size() > 0 ); @@ -84,7 +84,7 @@ const vector& ThemeMetricCourseDifficultiesToShow::GetValue() static void RemoveStepsTypes( vector& inout, CString sStepsTypesToRemove ) { - CStringArray v; + vector v; split( sStepsTypesToRemove, ",", v ); ASSERT( v.size() > 0 ); diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 22f98af36a..2301da7696 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -935,7 +935,7 @@ void Course::UpdateCourseStats( StepsType st ) bool Course::IsRanking() const { - CStringArray rankingsongs; + vector rankingsongs; split(THEME->GetMetric("ScreenRanking", "CoursesToShow"), ",", rankingsongs); diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index 41bdbd348b..f6eb341f2b 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -27,7 +27,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou { const CString sFName = SetExtension( out.m_sPath, "" ); - CStringArray arrayPossibleBanners; + vector arrayPossibleBanners; GetDirListing( sFName + "*.png", arrayPossibleBanners, false, true ); GetDirListing( sFName + "*.jpg", arrayPossibleBanners, false, true ); GetDirListing( sFName + "*.bmp", arrayPossibleBanners, false, 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 ) { - CStringArray sBits; + vector sBits; split( sParams[j], "=", sBits, false ); if( sBits.size() < 2 ) continue; @@ -149,7 +149,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou new_entry.bSecret = true; CString sSong = sParams[1]; sSong.Replace( "\\", "/" ); - CStringArray bits; + vector bits; split( sSong, "/", bits ); if( bits.size() == 2 ) { @@ -206,7 +206,7 @@ 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. */ - CStringArray mods; + vector mods; split( sParams[3], ",", mods, true ); for( int j = (int) mods.size()-1; j >= 0 ; --j ) { @@ -278,7 +278,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) // save group name { - CStringArray parts; + vector parts; split( sPath, "/", parts, false ); if( parts.size() >= 4 ) // e.g. "/Courses/blah/fun.cvs" out.m_sGroupName = parts[parts.size()-2]; diff --git a/stepmania/src/CourseWriterCRS.cpp b/stepmania/src/CourseWriterCRS.cpp index 152d9610e3..c10301eb29 100644 --- a/stepmania/src/CourseWriterCRS.cpp +++ b/stepmania/src/CourseWriterCRS.cpp @@ -58,7 +58,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin StepsType st = entry.first; CourseDifficulty cd = entry.second; - CStringArray asRadarValues; + vector asRadarValues; const RadarValues &rv = it->second; for( int r=0; r < NUM_RADAR_CATEGORIES; r++ ) asRadarValues.push_back( ssprintf("%.3f", rv[r]) ); @@ -103,7 +103,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin else if( entry.pSong ) { // strip off everything but the group name and song dir - CStringArray as; + vector as; ASSERT( entry.pSong != NULL ); split( entry.pSong->GetSongDir(), "/", as ); ASSERT( as.size() >= 2 ); diff --git a/stepmania/src/EditMenu.h b/stepmania/src/EditMenu.h index a7ab65d076..ec250d6f07 100644 --- a/stepmania/src/EditMenu.h +++ b/stepmania/src/EditMenu.h @@ -102,7 +102,7 @@ private: Difficulty dc; }; - CStringArray m_sGroups; + vector m_sGroups; vector m_pSongs; vector m_StepsTypes; vector m_vpSteps; diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 91e6e4a64b..89e69c76ac 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -333,10 +333,10 @@ void Font::SetDefaultGlyph( FontPage *pPage ) /* Given the INI for a font, find all of the texture pages for the font. */ -void Font::GetFontPaths( const CString &sFontIniPath, CStringArray &asTexturePathsOut ) +void Font::GetFontPaths( const CString &sFontIniPath, vector &asTexturePathsOut ) { CString sPrefix = SetExtension( sFontIniPath, "" ); - CStringArray asFiles; + vector asFiles; GetDirListing( sPrefix + "*", asFiles, false, true ); for( unsigned i = 0; i < asFiles.size(); ++i ) @@ -628,7 +628,7 @@ CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyph return CString(); } -static CStringArray LoadStack; +static vector LoadStack; /* * A font set is a set of files, eg: @@ -671,7 +671,7 @@ void Font::Load( const CString &sIniPath, CString sChars ) m_sChars = sChars; /* Get the filenames associated with this font. */ - CStringArray asTexturePaths; + vector asTexturePaths; GetFontPaths( sIniPath, asTexturePaths ); bool bCapitalsOnly = false; @@ -688,7 +688,7 @@ void Font::Load( const CString &sIniPath, CString sChars ) { /* If this is a top-level font (not a subfont), load the default font first. */ - CStringArray ImportList; + vector ImportList; if( LoadStack.size() == 1 ) ImportList.push_back("Common default"); diff --git a/stepmania/src/Font.h b/stepmania/src/Font.h index cb18b3a3fc..a36825fea0 100644 --- a/stepmania/src/Font.h +++ b/stepmania/src/Font.h @@ -159,7 +159,7 @@ private: CString m_sChars; void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CString &sTexturePath, const CString &PageName, CString sChars ); - static void GetFontPaths( const CString &sFontOrTextureFilePath, CStringArray &sTexturePaths ); + static void GetFontPaths( const CString &sFontOrTextureFilePath, vector &sTexturePaths ); CString GetPageNameFromFileName( const CString &sFilename ); }; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 35533174d5..002ceaf691 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2713,7 +2713,7 @@ const Game* GameManager::GetGameFromIndex( int index ) const bool GameManager::IsGameEnabled( const Game *pGame ) const { - CStringArray asNoteSkins; + vector asNoteSkins; NOTESKIN->GetNoteSkinNames( pGame, asNoteSkins, false ); /* don't omit default */ return asNoteSkins.size() > 0; } diff --git a/stepmania/src/GameSoundManager.cpp b/stepmania/src/GameSoundManager.cpp index e2333cb335..1283a76909 100644 --- a/stepmania/src/GameSoundManager.cpp +++ b/stepmania/src/GameSoundManager.cpp @@ -261,7 +261,7 @@ static void DoPlayOnceFromDir( CString sPath ) if( sPath.Right(1) != "/" ) sPath += "/"; - CStringArray arraySoundFiles; + vector arraySoundFiles; GetDirListing( sPath + "*.mp3", arraySoundFiles ); GetDirListing( sPath + "*.wav", arraySoundFiles ); GetDirListing( sPath + "*.ogg", arraySoundFiles ); diff --git a/stepmania/src/GroupList.cpp b/stepmania/src/GroupList.cpp index 7374d94062..64861353da 100644 --- a/stepmania/src/GroupList.cpp +++ b/stepmania/src/GroupList.cpp @@ -44,7 +44,7 @@ bool GroupList::ItemIsOnScreen( int n ) const return offset >= 0 && offset < MAX_GROUPS_ONSCREEN; } -void GroupList::Load( const CStringArray& asGroupNames ) +void GroupList::Load( const vector& asGroupNames ) { m_asLabels = asGroupNames; diff --git a/stepmania/src/GroupList.h b/stepmania/src/GroupList.h index f4ff698356..a44f2c71d6 100644 --- a/stepmania/src/GroupList.h +++ b/stepmania/src/GroupList.h @@ -34,7 +34,7 @@ public: CString GetSelectionName() const { return m_asLabels[m_iSelection]; } void Up(); void Down(); - void Load( const CStringArray& asGroupNames ); + void Load( const vector& asGroupNames ); void TweenOffScreen(); void TweenOnScreen(); }; diff --git a/stepmania/src/HelpDisplay.cpp b/stepmania/src/HelpDisplay.cpp index 3eaf24c00b..44e1b70ee6 100644 --- a/stepmania/src/HelpDisplay.cpp +++ b/stepmania/src/HelpDisplay.cpp @@ -35,7 +35,7 @@ void HelpDisplay::SetName( const CString &sName ) BitmapText::SetName( sName ); } -void HelpDisplay::SetTips( const CStringArray &arrayTips, const CStringArray &arrayTipsAlt ) +void HelpDisplay::SetTips( const vector &arrayTips, const vector &arrayTipsAlt ) { ASSERT( arrayTips.size() == arrayTipsAlt.size() ); @@ -117,7 +117,7 @@ public: static int gettips( T* p, lua_State *L ) { - CStringArray arrayTips, arrayTipsAlt; + vector arrayTips, arrayTipsAlt; p->GetTips( arrayTips, arrayTipsAlt ); LuaHelpers::CreateTableFromArray( arrayTips, L ); diff --git a/stepmania/src/HelpDisplay.h b/stepmania/src/HelpDisplay.h index 57a05d81b6..8264b635f8 100644 --- a/stepmania/src/HelpDisplay.h +++ b/stepmania/src/HelpDisplay.h @@ -18,9 +18,9 @@ public: void LoadFromNode( const CString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void SetTips( const CStringArray &arrayTips ) { SetTips( arrayTips, arrayTips ); } - void SetTips( const CStringArray &arrayTips, const CStringArray &arrayTipsAlt ); - void GetTips( CStringArray &arrayTipsOut, CStringArray &arrayTipsAltOut ) const { arrayTipsOut = m_arrayTips; arrayTipsAltOut = m_arrayTipsAlt; } + void SetTips( const vector &arrayTips ) { SetTips( arrayTips, arrayTips ); } + void SetTips( const vector &arrayTips, const vector &arrayTipsAlt ); + void GetTips( vector &arrayTipsOut, vector &arrayTipsAltOut ) const { arrayTipsOut = m_arrayTips; arrayTipsAltOut = m_arrayTipsAlt; } virtual void Update( float fDeltaTime ); virtual void SetName( const CString &sName ); @@ -31,7 +31,7 @@ public: protected: ThemeMetric TIP_SHOW_TIME; - CStringArray m_arrayTips, m_arrayTipsAlt; + vector m_arrayTips, m_arrayTipsAlt; int m_iCurTipIndex; float m_fSecsUntilSwitch; diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 9f06f499fc..8084ee3743 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -462,7 +462,7 @@ void InputMapper::ReadMappingsFromDisk() GameInput GameI; GameI.fromString( pGame, name ); - CStringArray sDeviceInputStrings; + vector sDeviceInputStrings; split( value, ",", sDeviceInputStrings, false ); for( unsigned i=0; i asGraphicPaths; if(MAXSONGSINBUFFER >= arraySongs.size() && SingleLoad != 1) // less than the MAXSONGSINBUFFER means we can get away with loading the lot in one go { diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index ba0222baff..30a66d81bc 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -68,7 +68,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData sSMNoteData.erase( iIndexCommentStart, iIndexCommentEnd-iIndexCommentStart ); } - CStringArray asMeasures; + vector asMeasures; split( sSMNoteData, ",", asMeasures, true ); // ignore empty is important for( unsigned m=0; m asMeasureLines; split( sMeasureString, "\n", asMeasureLines, true ); // ignore empty is important for( unsigned l=0; lm_szName + "/"; - CStringArray asNoteSkinNames; + vector asNoteSkinNames; GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true ); StripCvs( asNoteSkinNames ); @@ -96,12 +96,12 @@ void NoteSkinManager::LoadNoteSkinDataRecursive( const CString &sNoteSkinName, N } -void NoteSkinManager::GetNoteSkinNames( CStringArray &AddTo ) +void NoteSkinManager::GetNoteSkinNames( vector &AddTo ) { GetNoteSkinNames( GAMESTATE->m_pCurGame, AddTo ); } -void NoteSkinManager::GetNoteSkinNames( const Game* pGame, CStringArray &AddTo, bool bFilterDefault ) +void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddTo, bool bFilterDefault ) { if( pGame == m_pCurGame ) { @@ -121,7 +121,7 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, CStringArray &AddTo, /* Move "default" to the front if it exists. */ { - CStringArray::iterator iter = find( AddTo.begin(), AddTo.end(), "default" ); + vector::iterator iter = find( AddTo.begin(), AddTo.end(), "default" ); if( iter != AddTo.end() ) { AddTo.erase( iter ); @@ -134,7 +134,7 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, CStringArray &AddTo, bool NoteSkinManager::DoesNoteSkinExist( const CString &sSkinName ) { - CStringArray asSkinNames; + vector asSkinNames; GetNoteSkinNames( asSkinNames ); for( unsigned i=0; i matches; // fill this with the possible files GetDirListing( sDir+sFileName+"*", matches, false, true ); diff --git a/stepmania/src/NoteSkinManager.h b/stepmania/src/NoteSkinManager.h index d88b9afba0..a53b35c095 100644 --- a/stepmania/src/NoteSkinManager.h +++ b/stepmania/src/NoteSkinManager.h @@ -19,8 +19,8 @@ public: ~NoteSkinManager(); void RefreshNoteSkinData( const Game* game ); - void GetNoteSkinNames( const Game* game, CStringArray &AddTo, bool bFilterDefault=true ); - void GetNoteSkinNames( CStringArray &AddTo ); // looks up current const Game* in GAMESTATE + void GetNoteSkinNames( const Game* game, vector &AddTo, bool bFilterDefault=true ); + void GetNoteSkinNames( vector &AddTo ); // looks up current const Game* in GAMESTATE bool DoesNoteSkinExist( const CString &sNoteSkin ); // looks up current const Game* in GAMESTATE void SetCurrentNoteSkin( const CString &sNoteSkin ) { m_sCurrentNoteSkin = sNoteSkin; } diff --git a/stepmania/src/NotesLoader.cpp b/stepmania/src/NotesLoader.cpp index 2e543c185f..6d9fdfda60 100644 --- a/stepmania/src/NotesLoader.cpp +++ b/stepmania/src/NotesLoader.cpp @@ -5,7 +5,7 @@ bool NotesLoader::Loadable( CString sPath ) { - CStringArray list; + vector list; GetApplicableFiles( sPath, list ); return !list.empty(); } diff --git a/stepmania/src/NotesLoader.h b/stepmania/src/NotesLoader.h index 9d1b832379..318e3b3682 100644 --- a/stepmania/src/NotesLoader.h +++ b/stepmania/src/NotesLoader.h @@ -11,7 +11,7 @@ class Song; class NotesLoader { protected: - virtual void GetApplicableFiles( CString sPath, CStringArray &out )=0; + virtual void GetApplicableFiles( CString sPath, vector &out )=0; set BlacklistedImages; diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index a701700798..6783f5ada7 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -512,7 +512,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa return true; } -void BMSLoader::GetApplicableFiles( CString sPath, CStringArray &out ) +void BMSLoader::GetApplicableFiles( CString sPath, vector &out ) { GetDirListing( sPath + CString("*.bms"), out ); GetDirListing( sPath + CString("*.bme"), out ); @@ -852,7 +852,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) ASSERT( out.m_vsKeysoundFile.empty() ); m_sDir = sDir; - CStringArray arrayBMSFileNames; + vector arrayBMSFileNames; GetApplicableFiles( sDir, arrayBMSFileNames ); /* We should have at least one; if we had none, we shouldn't have been diff --git a/stepmania/src/NotesLoaderBMS.h b/stepmania/src/NotesLoaderBMS.h index 7cb629b61e..c830a12261 100644 --- a/stepmania/src/NotesLoaderBMS.h +++ b/stepmania/src/NotesLoaderBMS.h @@ -32,7 +32,7 @@ class BMSLoader: public NotesLoader map m_mapWavIdToKeysoundIndex; public: - void GetApplicableFiles( CString sPath, CStringArray &out ); + void GetApplicableFiles( CString sPath, vector &out ); bool LoadFromDir( CString sDir, Song &out ); }; diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index f21bb20b99..bdc2740512 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -442,12 +442,12 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) else if( 0==stricmp(sValueName,"FREEZE") ) { - CStringArray arrayFreezeExpressions; + vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); if( arrayFreezeValues.size() != 2 ) { @@ -464,12 +464,12 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) else if( 0==stricmp(sValueName,"CHANGEBPM") || 0==stricmp(sValueName,"BPMCHANGE") ) { - CStringArray arrayBPMChangeExpressions; + vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if( arrayBPMChangeValues.size() != 2 ) { @@ -536,14 +536,14 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) return true; } -void DWILoader::GetApplicableFiles( CString sPath, CStringArray &out ) +void DWILoader::GetApplicableFiles( CString sPath, vector &out ) { GetDirListing( sPath + CString("*.dwi"), out ); } bool DWILoader::LoadFromDir( CString sPath, Song &out ) { - CStringArray aFileNames; + vector aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) diff --git a/stepmania/src/NotesLoaderDWI.h b/stepmania/src/NotesLoaderDWI.h index 4379d32a30..9e50d7c377 100644 --- a/stepmania/src/NotesLoaderDWI.h +++ b/stepmania/src/NotesLoaderDWI.h @@ -26,7 +26,7 @@ class DWILoader: public NotesLoader CString m_sLoadingFile; public: - void GetApplicableFiles( CString sPath, CStringArray &out ); + void GetApplicableFiles( CString sPath, vector &out ); bool Loadable( CString sPath ); bool LoadFromDir( CString sPath, Song &out ); }; diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index aee3ccfce6..cfe8180bfd 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -68,7 +68,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Steps &out, const Song &s RageException::Throw( "Error opening file '%s'.", sPath.c_str() ); int iTickCount = -1; // this is the value we read for TICKCOUNT - CStringArray asRows; + vector asRows; for( unsigned i=0; i &out ) { GetDirListing( sPath + CString("*.ksf"), out ); } @@ -229,7 +229,7 @@ void KSFLoader::LoadTags( const CString &str, Song &out ) { /* str is either a #TITLE or a directory component. Fill in missing information. * str is either "title", "artist - title", or "artist - title - difficulty". */ - CStringArray asBits; + vector asBits; split( str, " - ", asBits, false ); /* Ignore the difficulty, since we get that elsewhere. */ if( asBits.size() == 3 && @@ -323,7 +323,7 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) /* Try to fill in missing bits of information from the pathname. */ { - CStringArray asBits; + vector asBits; split( sPath, "/", asBits, true); ASSERT(asBits.size() > 1); @@ -331,7 +331,7 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) } // search for music with song in the file name - CStringArray arrayPossibleMusic; + vector arrayPossibleMusic; GetDirListing( out.GetSongDir() + CString("song.mp3"), arrayPossibleMusic ); GetDirListing( out.GetSongDir() + CString("song.ogg"), arrayPossibleMusic ); GetDirListing( out.GetSongDir() + CString("song.wav"), arrayPossibleMusic ); @@ -346,7 +346,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out ) { LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir.c_str() ); - CStringArray arrayKSFFileNames; + vector arrayKSFFileNames; GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames ); /* We shouldn't have been called to begin with if there were no KSFs. */ diff --git a/stepmania/src/NotesLoaderKSF.h b/stepmania/src/NotesLoaderKSF.h index b645dd8ed5..cbd0628faa 100644 --- a/stepmania/src/NotesLoaderKSF.h +++ b/stepmania/src/NotesLoaderKSF.h @@ -17,7 +17,7 @@ class KSFLoader: public NotesLoader void LoadTags( const CString &str, Song &out ); public: - void GetApplicableFiles( CString sPath, CStringArray &out ); + void GetApplicableFiles( CString sPath, vector &out ); bool LoadFromDir( CString sDir, Song &out ); }; diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index c4a104d1b1..40e6c061ae 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -47,7 +47,7 @@ void SMLoader::LoadFromSMTokens( out.SetDifficulty( DIFFICULTY_CHALLENGE ); out.SetMeter(atoi(sMeter)); - CStringArray saValues; + vector saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() == NUM_RADAR_CATEGORIES ) { @@ -62,7 +62,7 @@ void SMLoader::LoadFromSMTokens( out.TidyUpData(); } -void SMLoader::GetApplicableFiles( CString sPath, CStringArray &out ) +void SMLoader::GetApplicableFiles( CString sPath, vector &out ) { GetDirListing( sPath + CString("*.sm"), out ); } @@ -99,12 +99,12 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) } else if( sValueName=="STOPS" || sValueName=="FREEZES" ) { - CStringArray arrayFreezeExpressions; + vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); /* XXX: Once we have a way to display warnings that the user actually * cares about (unlike most warnings), this should be one of them. */ @@ -130,12 +130,12 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) else if( sValueName=="BPMS" ) { - CStringArray arrayBPMChangeExpressions; + vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); /* XXX: Once we have a way to display warnings that the user actually * cares about (unlike most warnings), this should be one of them. */ @@ -161,7 +161,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) bool LoadFromBGChangesString( BackgroundChange &change, const CString &sBGChangeExpression ) { - CStringArray aBGChangeValues; + vector aBGChangeValues; split( sBGChangeExpression, "=", aBGChangeValues, false ); aBGChangeValues.resize( min((int)aBGChangeValues.size(),11) ); @@ -377,7 +377,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) } else { - CStringArray aBGChangeExpressions; + vector aBGChangeExpressions; split( sParams[1], ",", aBGChangeExpressions ); for( unsigned b=0; b aFGChangeExpressions; split( sParams[1], ",", aFGChangeExpressions ); for( unsigned b=0; b aKeysoundFiles; split( sParams[1], ",", aKeysoundFiles ); for( unsigned k=0; k aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) diff --git a/stepmania/src/NotesLoaderSM.h b/stepmania/src/NotesLoaderSM.h index 95716aeded..b397928b89 100644 --- a/stepmania/src/NotesLoaderSM.h +++ b/stepmania/src/NotesLoaderSM.h @@ -33,7 +33,7 @@ public: return LoadFromSMFile( sPath, out ); } - void GetApplicableFiles( CString sPath, CStringArray &out ); + void GetApplicableFiles( CString sPath, vector &out ); bool LoadFromDir( CString sPath, Song &out ); void TidyUpData( Song &song, bool cache ); static bool LoadTimingFromFile( const CString &fn, TimingData &out ); diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 3cec6198dc..d90401e41d 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -170,7 +170,7 @@ CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bS lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); int MaxRadar = bSavingCache? NUM_RADAR_CATEGORIES:5; - CStringArray asRadarValues; + vector asRadarValues; for( int r=0; r < MaxRadar; r++ ) asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) ); /* Don't append a newline here; it's added in NoteDataUtil::GetSMNoteDataString. diff --git a/stepmania/src/OptionIconRow.cpp b/stepmania/src/OptionIconRow.cpp index 121b254851..986c6621cf 100644 --- a/stepmania/src/OptionIconRow.cpp +++ b/stepmania/src/OptionIconRow.cpp @@ -103,7 +103,7 @@ void OptionIconRow::SetFromGameState( PlayerNumber pn ) // init CString sOptions = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetString(); - CStringArray asOptions; + vector asOptions; split( sOptions, ", ", asOptions, true ); diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index efba2a0351..1f2654ba1f 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -277,7 +277,7 @@ public: defOut.m_bOneChoiceForAllPlayers = false; defOut.m_bAllowThemeItems = false; // we theme the text ourself - CStringArray arraySkinNames; + vector arraySkinNames; NOTESKIN->GetNoteSkinNames( arraySkinNames ); for( unsigned skin=0; skin asBits; split( sOptions, ",", asBits, true ); FOREACH( CString, asBits, bit ) @@ -221,7 +221,7 @@ void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid ) float level = 1; float speed = 1; - CStringArray asParts; + vector asParts; split( sBit, " ", asParts, true ); FOREACH_CONST( CString, asParts, s ) @@ -624,7 +624,7 @@ void PlayerOptions::GetThemedMods( vector &AddTo ) const ASSERT( !sOneMod.empty() ); - CStringArray asTokens; + vector asTokens; split( sOneMod, " ", asTokens ); if( asTokens.empty() ) diff --git a/stepmania/src/RadarValues.cpp b/stepmania/src/RadarValues.cpp index 49d921cb98..5969f95270 100644 --- a/stepmania/src/RadarValues.cpp +++ b/stepmania/src/RadarValues.cpp @@ -66,7 +66,7 @@ CString RadarValues::ToString( int iMaxValues ) const iMaxValues = NUM_RADAR_CATEGORIES; iMaxValues = min( iMaxValues, (int)NUM_RADAR_CATEGORIES ); - CStringArray asRadarValues; + vector asRadarValues; for( int r=0; r < iMaxValues; r++ ) asRadarValues.push_back( ssprintf("%.3f", m_Values.f[r]) ); @@ -75,7 +75,7 @@ CString RadarValues::ToString( int iMaxValues ) const void RadarValues::FromString( CString sRadarValues ) { - CStringArray saValues; + vector saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() != NUM_RADAR_CATEGORIES ) diff --git a/stepmania/src/RageFileDriver.cpp b/stepmania/src/RageFileDriver.cpp index f7b0e9f4f5..607fee467a 100644 --- a/stepmania/src/RageFileDriver.cpp +++ b/stepmania/src/RageFileDriver.cpp @@ -42,7 +42,7 @@ int RageFileDriver::GetPathValue( const CString &path ) return 0; } -void RageFileDriver::GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void RageFileDriver::GetDirListing( const CString &sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { FDB->GetDirListing( sPath, AddTo, bOnlyDirs, bReturnPathToo ); } diff --git a/stepmania/src/RageFileDriver.h b/stepmania/src/RageFileDriver.h index 3b465b7a21..5470b19169 100644 --- a/stepmania/src/RageFileDriver.h +++ b/stepmania/src/RageFileDriver.h @@ -13,7 +13,7 @@ public: RageFileDriver( FilenameDB *db ) { FDB = db; } virtual ~RageFileDriver(); virtual RageFileBasic *Open( const CString &path, int mode, int &err ) = 0; - virtual void GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ); + virtual void GetDirListing( const CString &sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ); virtual RageFileManager::FileType GetFileType( const CString &sPath ); virtual int GetFileSizeInBytes( const CString &sFilePath ); virtual int GetFileHash( const CString &sPath ); diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index bc60c188e3..b3726784ed 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -119,7 +119,7 @@ bool WinMoveFile( CString sOldPath, CString sNewPath ) bool CreateDirectories( CString Path ) { /* XXX: handle "//foo/bar" paths in Windows */ - CStringArray parts; + vector parts; CString curpath; /* If Path is absolute, add the initial slash ("ignore empty" will remove it). */ diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 02b4385f1c..b47233e83a 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -294,7 +294,7 @@ static void NormalizePath( CString &sPath ) bool ilt( const CString &a, const CString &b ) { return a.CompareNoCase(b) < 0; } bool ieq( const CString &a, const CString &b ) { return a.CompareNoCase(b) == 0; } -void RageFileManager::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void RageFileManager::GetDirListing( CString sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { NormalizePath( sPath ); @@ -334,7 +334,7 @@ void RageFileManager::GetDirListing( CString sPath, CStringArray &AddTo, bool bO { /* More than one driver returned files. Remove duplicates (case-insensitively). */ sort( AddTo.begin()+iOldSize, AddTo.end(), ilt ); - CStringArray::iterator it = unique( AddTo.begin()+iOldSize, AddTo.end(), ieq ); + vector::iterator it = unique( AddTo.begin()+iOldSize, AddTo.end(), ieq ); AddTo.erase( it, AddTo.end() ); } } @@ -827,12 +827,12 @@ unsigned GetFileSizeInBytes( const CString &sPath ) return FILEMAN->GetFileSizeInBytes( sPath ); } -void GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void GetDirListing( const CString &sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { FILEMAN->GetDirListing( sPath, AddTo, bOnlyDirs, bReturnPathToo ); } -void GetDirListingRecursive( const CString &sDir, const CString &sMatch, CStringArray &AddTo ) +void GetDirListingRecursive( const CString &sDir, const CString &sMatch, vector &AddTo ) { ASSERT( sDir.Right(1) == "/" ); GetDirListing( sDir+sMatch, AddTo, false, true ); @@ -883,7 +883,7 @@ unsigned int GetHashForDirectory( const CString &sDir ) hash += GetHashForString( sDir ); - CStringArray arrayFiles; + vector arrayFiles; GetDirListing( sDir+"*", arrayFiles, false ); for( unsigned i=0; i &AddTo, bool bOnlyDirs, bool bReturnPathToo ); bool Move( CString sOldPath, CString sNewPath ); bool Remove( CString sPath ); void CreateDir( CString sDir ); diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 8ca76512fc..797a725462 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -52,7 +52,7 @@ void RageTexture::CreateFrameRects() void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWide, int* piFramesHigh ) { static Regex match( " ([0-9]+)x([0-9]+)([\\. ]|$)" ); - CStringArray asMatch; + vector asMatch; if( !match.Compare(sPath, asMatch) ) { *piFramesWide = *piFramesHigh = 1; diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 6467d98ec3..343a9cee89 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -108,7 +108,7 @@ bool IsHexVal( const CString &s ) float HHMMSSToSeconds( const CString &sHHMMSS ) { - CStringArray arrayBits; + vector arrayBits; split( sHHMMSS, ":", arrayBits, false ); while( arrayBits.size() < 3 ) @@ -457,7 +457,7 @@ CString GetLanguageNameFromISO639Code( CString sName ) return ""; } -CString join( const CString &Deliminator, const CStringArray& Source) +CString join( const CString &Deliminator, const vector& Source) { if( Source.empty() ) return CString(); @@ -473,7 +473,7 @@ CString join( const CString &Deliminator, const CStringArray& Source) return csTmp; } -CString join( const CString &Delimitor, CStringArray::const_iterator begin, CStringArray::const_iterator end ) +CString join( const CString &Delimitor, vector::const_iterator begin, vector::const_iterator end ) { if( begin == end ) return CString(); @@ -540,7 +540,7 @@ void do_split( const S &Source, const C Delimitor, vector &AddIt, const bool } -void split( const CString &Source, const CString &Delimitor, CStringArray &AddIt, const bool bIgnoreEmpty ) +void split( const CString &Source, const CString &Delimitor, vector &AddIt, const bool bIgnoreEmpty ) { if( Delimitor.size() == 1 ) do_split( Source, Delimitor[0], AddIt, bIgnoreEmpty ); @@ -634,7 +634,7 @@ void splitpath( const CString &Path, CString& Dir, CString& Filename, CString& E { Dir = Filename = Ext = ""; - CStringArray mat; + vector mat; /* One level of escapes for the regex, one for C. Ew. * This is really: @@ -802,7 +802,7 @@ bool DirectoryIsEmpty( const CString &dir ) if(!DoesFileExist(dir)) return true; - CStringArray asFileNames; + vector asFileNames; GetDirListing( dir, asFileNames ); return asFileNames.empty(); } @@ -817,7 +817,7 @@ bool CompareCStringsDesc(const CString &str1, const CString &str2) return str1.CompareNoCase( str2 ) > 0; } -void SortCStringArray( CStringArray &arrayCStrings, const bool bSortAscending ) +void SortCStringArray( vector &arrayCStrings, const bool bSortAscending ) { sort( arrayCStrings.begin(), arrayCStrings.end(), bSortAscending?CompareCStringsAsc:CompareCStringsDesc); diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index a228b2b9fd..6c3ff8baba 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -280,8 +280,8 @@ wstring CStringToWstring( const CString &sString ); CString GetLanguageNameFromISO639Code( CString sName ); -// Splits a CString into an CStringArray according the Delimitor. -void split( const CString &sSource, const CString &sDelimitor, CStringArray& asAddIt, const bool bIgnoreEmpty = true ); +// Splits a CString into an vector according the Delimitor. +void split( const CString &sSource, const CString &sDelimitor, vector& asAddIt, const bool bIgnoreEmpty = true ); void split( const wstring &sSource, const wstring &sDelimitor, vector &asAddIt, const bool bIgnoreEmpty = true ); /* In-place split. */ @@ -292,9 +292,9 @@ void split( const wstring &sSource, const wstring &sDelimitor, int &iBegin, int void split( const CString &sSource, const CString &sDelimitor, int &iBegin, int &iSize, int iLen, const bool bIgnoreEmpty ); /* no default to avoid ambiguity */ void split( const wstring &sSource, const wstring &sDelimitor, int &iBegin, int &iSize, int iLen, const bool bIgnoreEmpty ); -// Joins a CStringArray to create a CString according the Deliminator. -CString join( const CString &sDelimitor, const CStringArray& sSource ); -CString join( const CString &sDelimitor, CStringArray::const_iterator begin, CStringArray::const_iterator end ); +// Joins a vector to create a CString according the Deliminator. +CString join( const CString &sDelimitor, const vector& sSource ); +CString join( const CString &sDelimitor, vector::const_iterator begin, vector::const_iterator end ); CString GetCwd(); @@ -311,7 +311,7 @@ bool DirectoryIsEmpty( const CString &sPath ); bool CompareCStringsAsc( const CString &sStr1, const CString &sStr2 ); bool CompareCStringsDesc( const CString &sStr1, const CString &sStr2 ); -void SortCStringArray( CStringArray &asAddTo, const bool bSortAscending = true ); +void SortCStringArray( vector &asAddTo, const bool bSortAscending = true ); /* Find the mean and standard deviation of all numbers in [start,end). */ float calc_mean( const float *pStart, const float *pEnd ); @@ -424,8 +424,8 @@ typedef basic_string istring; /* Compatibility/convenience shortcuts. These are actually defined in RageFileManager.h, but * declared here since they're used in many places. */ -void GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false ); -void GetDirListingRecursive( const CString &sDir, const CString &sMatch, CStringArray &AddTo ); /* returns path too */ +void GetDirListing( const CString &sPath, vector &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false ); +void GetDirListingRecursive( const CString &sDir, const CString &sMatch, vector &AddTo ); /* returns path too */ bool DeleteRecursive( const CString &sDir ); /* delete the dir and all files/subdirs inside it */ bool DoesFileExist( const CString &sPath ); bool IsAFile( const CString &sPath ); diff --git a/stepmania/src/RageUtil_CharConversions.cpp b/stepmania/src/RageUtil_CharConversions.cpp index a64042e481..40ba6bb0d3 100644 --- a/stepmania/src/RageUtil_CharConversions.cpp +++ b/stepmania/src/RageUtil_CharConversions.cpp @@ -101,7 +101,7 @@ static bool AttemptJapaneseConversion( CString &txt ) { return false; } bool ConvertString(CString &str, const CString &encodings) { - CStringArray lst; + vector lst; split(encodings, ",", lst); for(unsigned i = 0; i < lst.size(); ++i) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 913564a1c4..8a151a0756 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -386,8 +386,8 @@ void FilenameDB::AddFile( const CString &sPath_, int iSize, int iHash, void *pPr vector asParts; split( sPath, "/", asParts, false ); - CStringArray::const_iterator begin = asParts.begin(); - CStringArray::const_iterator end = asParts.end(); + vector::const_iterator begin = asParts.begin(); + vector::const_iterator end = asParts.end(); bool IsDir = true; if( sPath[sPath.size()-1] != '/' ) @@ -545,7 +545,7 @@ const void *FilenameDB::GetFilePriv( const CString &path ) -void FilenameDB::GetDirListing( CString sPath, CStringArray &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) +void FilenameDB::GetDirListing( CString sPath, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) { // LOG->Trace( "GetDirListing( %s )", sPath.c_str() ); diff --git a/stepmania/src/RageUtil_FileDB.h b/stepmania/src/RageUtil_FileDB.h index c3a3f3be4a..68d139c151 100644 --- a/stepmania/src/RageUtil_FileDB.h +++ b/stepmania/src/RageUtil_FileDB.h @@ -103,7 +103,7 @@ public: RageFileManager::FileType GetFileType( const CString &sPath ); int GetFileSize( const CString &sPath ); int GetFileHash( const CString &sFilePath ); - void GetDirListing( CString sPath, CStringArray &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); + void GetDirListing( CString sPath, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); void FlushDirCache(); diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index 55abe1a111..d87c6fb4ce 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -51,7 +51,7 @@ bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad ) sDir += "/"; #endif - CStringArray arraySoundFiles; + vector arraySoundFiles; GetDirListing( sDir + "*.mp3", arraySoundFiles ); GetDirListing( sDir + "*.ogg", arraySoundFiles ); GetDirListing( sDir + "*.wav", arraySoundFiles ); diff --git a/stepmania/src/ScoreDisplayBattle.cpp b/stepmania/src/ScoreDisplayBattle.cpp index 81f1c8f1b4..03101f72f2 100644 --- a/stepmania/src/ScoreDisplayBattle.cpp +++ b/stepmania/src/ScoreDisplayBattle.cpp @@ -26,7 +26,7 @@ ScoreDisplayBattle::ScoreDisplayBattle() this->AddChild( &m_ItemIcon[i] ); } - CStringArray asIconPaths; + vector asIconPaths; GetDirListing( THEME->GetCurThemeDir()+"Graphic/ScoreDisplayBattle icon*", asIconPaths ); for( unsigned j=0; j strArray; CString text("Use the left analog stick to translate the screen and right right analog stick to scale"); strArray.push_back(text); m_textHelp->SetTips(strArray); diff --git a/stepmania/src/ScreenEz2SelectMusic.h b/stepmania/src/ScreenEz2SelectMusic.h index 85495ad531..2eed043a0b 100644 --- a/stepmania/src/ScreenEz2SelectMusic.h +++ b/stepmania/src/ScreenEz2SelectMusic.h @@ -36,7 +36,7 @@ protected: void UpdateOptions( PlayerNumber pn, int nosound ); CString sOptions; - CStringArray asOptions; + vector asOptions; void TweenOffScreen(); diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 9d1ed8930f..826d3a2856 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -32,13 +32,13 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): void ScreenOptionsMaster::Init() { - CStringArray asLineNames; + vector asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) RageException::Throw( "%s::LineNames is empty.", m_sName.c_str() ); - CStringArray Flags; + vector Flags; split( OPTION_MENU_FLAGS, ";", Flags, true ); InputMode im = INPUTMODE_INDIVIDUAL; bool Explanations = false; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 64c11cc2ed..dc8a1bbd9b 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -24,7 +24,7 @@ static void GetPrefsDefaultModifiers( PlayerOptions &po, SongOptions &so ) static void SetPrefsDefaultModifiers( const PlayerOptions &po, const SongOptions &so ) { - CStringArray as; + vector as; if( po.GetString() != "" ) as.push_back( po.GetString() ); if( so.GetString() != "" ) @@ -119,7 +119,7 @@ static void MovePref( int &iSel, bool bToSel, const ConfOption *pConfOption ) } } -static void GameChoices( CStringArray &out ) +static void GameChoices( vector &out ) { vector aGames; GAMEMAN->GetEnabledGames( aGames ); @@ -133,7 +133,7 @@ static void GameChoices( CStringArray &out ) static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) { - CStringArray choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -151,14 +151,14 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void LanguageChoices( CStringArray &out ) +static void LanguageChoices( vector &out ) { THEME->GetLanguages( out ); } static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) { - CStringArray choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -175,12 +175,12 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void ThemeChoices( CStringArray &out ) +static void ThemeChoices( vector &out ) { THEME->GetThemeNames( out ); } -static void DisplayResolutionChoices( CStringArray &out ) +static void DisplayResolutionChoices( vector &out ) { DisplayResolutions d; DISPLAY->GetDisplayResolutions( d ); @@ -194,7 +194,7 @@ static void DisplayResolutionChoices( CStringArray &out ) static void Theme( int &sel, bool ToSel, const ConfOption *pConfOption ) { - CStringArray choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -210,7 +210,7 @@ static void Theme( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void AnnouncerChoices( CStringArray &out ) +static void AnnouncerChoices( vector &out ) { ANNOUNCER->GetAnnouncerNames( out ); out.insert( out.begin(), "Off" ); @@ -218,7 +218,7 @@ static void AnnouncerChoices( CStringArray &out ) static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) { - CStringArray choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -233,7 +233,7 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void DefaultNoteSkinChoices( CStringArray &out ) +static void DefaultNoteSkinChoices( vector &out ) { NOTESKIN->GetNoteSkinNames( out ); for( unsigned i = 0; i < out.size(); ++i ) @@ -242,7 +242,7 @@ static void DefaultNoteSkinChoices( CStringArray &out ) static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption ) { - CStringArray choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -670,7 +670,7 @@ void ConfOption::UpdateAvailableOptions() } } -void ConfOption::MakeOptionsList( CStringArray &out ) const +void ConfOption::MakeOptionsList( vector &out ) const { out = names; } diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index 1a3471d218..9de3fec01b 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -28,7 +28,7 @@ struct ConfOption /* Return the list of available selections; Get() and Put() use indexes into this * array. UpdateAvailableOptions() should be called before using this. */ - void MakeOptionsList( CStringArray &out ) const; + void MakeOptionsList( vector &out ) const; inline int Get() const { int sel; MoveData( sel, true, this ); return sel; } inline void Put( int sel ) const { MoveData( sel, false, this ); } @@ -49,7 +49,7 @@ struct ConfOption #undef PUSH ConfOption( const char *n, MoveData_t m, - void (*lst)( CStringArray &out ) ) + void (*lst)( vector &out ) ) { name = n; MoveData = m; @@ -61,7 +61,7 @@ struct ConfOption // private: vector names; - void (*MakeOptionsListCB)( CStringArray &out ); + void (*MakeOptionsListCB)( vector &out ); }; #endif diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index 3d8820b21c..8accf381cd 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -510,7 +510,7 @@ void ScreenPackages::EnterURL( const CString & sURL ) //if we are not talking about a file, let's not worry if( m_sEndName != "" && m_bIsPackage ) { - CStringArray AddTo; + vector AddTo; GetDirListing( "Packages/"+m_sEndName, AddTo, false, false ); if ( AddTo.size() > 0 ) { diff --git a/stepmania/src/ScreenPackages.h b/stepmania/src/ScreenPackages.h index 080b0bec97..c4b882138c 100644 --- a/stepmania/src/ScreenPackages.h +++ b/stepmania/src/ScreenPackages.h @@ -46,7 +46,7 @@ private: BitmapText m_textPackages; BitmapText m_textWeb; - CStringArray m_Packages; + vector m_Packages; vector m_Links; vector m_LinkTitles; diff --git a/stepmania/src/ScreenProfileOptions.cpp b/stepmania/src/ScreenProfileOptions.cpp index 2b803c5b09..54a85e5393 100644 --- a/stepmania/src/ScreenProfileOptions.cpp +++ b/stepmania/src/ScreenProfileOptions.cpp @@ -95,7 +95,7 @@ void ScreenProfileOptions::ImportOptions( int iRow, const vector & vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); - CStringArray::iterator iter = find( + vector::iterator iter = find( vsProfiles.begin(), vsProfiles.end(), MemoryCardManager::m_sMemoryCardOsMountPoint[pn].Get() ); diff --git a/stepmania/src/ScreenSMOnlineLogin.cpp b/stepmania/src/ScreenSMOnlineLogin.cpp index 0d1cbbca9a..d31ef1b773 100644 --- a/stepmania/src/ScreenSMOnlineLogin.cpp +++ b/stepmania/src/ScreenSMOnlineLogin.cpp @@ -66,7 +66,7 @@ void ScreenSMOnlineLogin::ImportOptions( int iRow, const vector &v FOREACH_PlayerNumber( pn ) { - CStringArray::iterator iter = find(vsProfiles.begin(), vsProfiles.end(), ProfileManager::m_sDefaultLocalProfileID[pn].Get() ); + vector::iterator iter = find(vsProfiles.begin(), vsProfiles.end(), ProfileManager::m_sDefaultLocalProfileID[pn].Get() ); if( iter != vsProfiles.end() ) m_pRows[0]->SetOneSelection((PlayerNumber) pn, iter - vsProfiles.begin()); } diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 66ba9b5b91..79d0d646f9 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -47,7 +47,7 @@ void ScreenSelect::Init() // element in the list is a choice name. This level of indirection // makes it easier to add or remove items without having to change a bunch // of indices. - CStringArray asChoiceNames; + vector asChoiceNames; split( CHOICE_NAMES, ",", asChoiceNames, true ); for( unsigned c=0; c vsCodeNames; split( CODE_NAMES, ",", vsCodeNames, true ); for( unsigned c=0; c GraphicPaths; m_iNumChoices = 0; unsigned i=0; unsigned j=0; diff --git a/stepmania/src/ScreenSelectMode.h b/stepmania/src/ScreenSelectMode.h index a304a6754b..e76812646e 100644 --- a/stepmania/src/ScreenSelectMode.h +++ b/stepmania/src/ScreenSelectMode.h @@ -44,7 +44,7 @@ protected: RageSound m_soundModeChange; RageSound m_soundConfirm; RageSound m_soundStart; - CStringArray arrayLocations; + vector arrayLocations; ScrollingList m_ScrollingList; Sprite m_ChoiceListFrame; Sprite m_ChoiceListHighlight; diff --git a/stepmania/src/ScreenTestInput.cpp b/stepmania/src/ScreenTestInput.cpp index fe8050d290..985f250340 100644 --- a/stepmania/src/ScreenTestInput.cpp +++ b/stepmania/src/ScreenTestInput.cpp @@ -68,7 +68,7 @@ void ScreenTestInput::Update( float fDeltaTime ) { Screen::Update( fDeltaTime ); - CStringArray asInputs; + vector asInputs; DeviceInput di; diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 2b796d20d2..c9d9267388 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -195,7 +195,7 @@ ScreenWithMenuElements::~ScreenWithMenuElements() void ScreenWithMenuElements::LoadHelpText() { - CStringArray vs; + vector vs; CString s = THEME->GetMetric(m_sName,"HelpText"); split( s, "\n", vs ); diff --git a/stepmania/src/ScrollingList.cpp b/stepmania/src/ScrollingList.cpp index 8a707e3315..ee6433b3bd 100644 --- a/stepmania/src/ScrollingList.cpp +++ b/stepmania/src/ScrollingList.cpp @@ -145,7 +145,7 @@ void ScrollingList::StopBouncing() Allows us to create a graphic element in the scrolling list *************************************/ -void ScrollingList::Load( const CStringArray& asGraphicPaths ) +void ScrollingList::Load( const vector& asGraphicPaths ) { Unload(); if(m_iSpriteType == SPRITE_TYPE_SPRITE) diff --git a/stepmania/src/ScrollingList.h b/stepmania/src/ScrollingList.h index db0639c887..e0e33c7257 100644 --- a/stepmania/src/ScrollingList.h +++ b/stepmania/src/ScrollingList.h @@ -13,7 +13,7 @@ public: ScrollingList(); ~ScrollingList(); - void Load( const CStringArray& asGraphicPaths ); + void Load( const vector& asGraphicPaths ); void Unload(); // delete all items. Called automatically on Load() virtual void Update( float fDeltaTime ); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index c4e42bcb7c..74206a9e29 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -218,7 +218,7 @@ bool Song::LoadFromSongDir( CString sDir ) m_sSongDir = sDir; // save group name - CStringArray sDirectoryParts; + vector sDirectoryParts; split( m_sSongDir, "/", sDirectoryParts, false ); ASSERT( sDirectoryParts.size() >= 4 ); /* e.g. "/Songs/Slow/Taps/" */ m_sGroupName = sDirectoryParts[sDirectoryParts.size()-3]; // second from last item @@ -315,7 +315,7 @@ bool Song::LoadFromSongDir( CString sDir ) return true; // do load this song } -static void GetImageDirListing( CString sPath, CStringArray &AddTo, bool bReturnPathToo=false ) +static void GetImageDirListing( CString sPath, vector &AddTo, bool bReturnPathToo=false ) { GetDirListing( sPath + ".png", AddTo, false, bReturnPathToo ); GetDirListing( sPath + ".jpg", AddTo, false, bReturnPathToo ); @@ -460,7 +460,7 @@ void Song::TidyUpData() if( !HasMusic() ) { - CStringArray arrayPossibleMusic; + vector arrayPossibleMusic; GetDirListing( m_sSongDir + CString("*.mp3"), arrayPossibleMusic ); GetDirListing( m_sSongDir + CString("*.ogg"), arrayPossibleMusic ); GetDirListing( m_sSongDir + CString("*.wav"), arrayPossibleMusic ); @@ -592,7 +592,7 @@ void Song::TidyUpData() // m_sBannerFile = ""; // find an image with "banner" in the file name - CStringArray arrayPossibleBanners; + vector arrayPossibleBanners; GetImageDirListing( m_sSongDir + "*banner*", arrayPossibleBanners ); /* Some people do things differently for the sake of being different. Don't @@ -608,7 +608,7 @@ void Song::TidyUpData() // m_sBackgroundFile = ""; // find an image with "bg" or "background" in the file name - CStringArray arrayPossibleBGs; + vector arrayPossibleBGs; GetImageDirListing( m_sSongDir + "*bg*", arrayPossibleBGs ); GetImageDirListing( m_sSongDir + "*background*", arrayPossibleBGs ); if( !arrayPossibleBGs.empty() ) @@ -618,7 +618,7 @@ void Song::TidyUpData() if( !HasCDTitle() ) { // find an image with "cdtitle" in the file name - CStringArray arrayPossibleCDTitles; + vector arrayPossibleCDTitles; GetImageDirListing( m_sSongDir + "*cdtitle*", arrayPossibleCDTitles ); if( !arrayPossibleCDTitles.empty() ) m_sCDTitleFile = arrayPossibleCDTitles[0]; @@ -627,7 +627,7 @@ void Song::TidyUpData() if( !HasLyrics() ) { // Check if there is a lyric file in here - CStringArray arrayLyricFiles; + vector arrayLyricFiles; GetDirListing(m_sSongDir + CString("*.lrc"), arrayLyricFiles ); if( !arrayLyricFiles.empty() ) m_sLyricsFile = arrayLyricFiles[0]; @@ -636,7 +636,7 @@ void Song::TidyUpData() // // Now, For the images we still haven't found, look at the image dimensions of the remaining unclassified images. // - CStringArray arrayImages; + vector arrayImages; GetImageDirListing( m_sSongDir + "*", arrayImages ); for( unsigned i=0; i arrayPossibleMovies; GetDirListing( m_sSongDir + CString("*.avi"), arrayPossibleMovies ); GetDirListing( m_sSongDir + CString("*.mpg"), arrayPossibleMovies ); GetDirListing( m_sSongDir + CString("*.mpeg"), arrayPossibleMovies ); @@ -766,7 +766,7 @@ void Song::TidyUpData() * filename, and should always be the title of the song (unlike KSFs). */ m_sSongFileName = m_sSongDir; - CStringArray asFileNames; + vector asFileNames; GetDirListing( m_sSongDir+"*.sm", asFileNames ); if( !asFileNames.empty() ) m_sSongFileName += asFileNames[0]; @@ -1003,7 +1003,7 @@ void Song::Save() /* We've safely written our files and created backups. Rename non-SM and non-DWI * files to avoid confusion. */ - CStringArray arrayOldFileNames; + vector arrayOldFileNames; GetDirListing( m_sSongDir + "*.bms", arrayOldFileNames ); GetDirListing( m_sSongDir + "*.ksf", arrayOldFileNames ); @@ -1390,7 +1390,7 @@ bool Song::Matches(CString sGroup, CString sSong) const CString sDir = this->GetSongDir(); sDir.Replace("\\","/"); - CStringArray bits; + vector bits; split( sDir, "/", bits ); ASSERT(bits.size() >= 2); /* should always have at least two parts */ const CString &sLastBit = bits[bits.size()-1]; diff --git a/stepmania/src/SongCacheIndex.cpp b/stepmania/src/SongCacheIndex.cpp index e2b7e5d924..3946166eae 100644 --- a/stepmania/src/SongCacheIndex.cpp +++ b/stepmania/src/SongCacheIndex.cpp @@ -50,7 +50,7 @@ static void EmptyDir( CString dir ) { ASSERT(dir[dir.size()-1] == '/'); - CStringArray asCacheFileNames; + vector asCacheFileNames; GetDirListing( dir, asCacheFileNames ); for( unsigned i=0; i arrayFiles; GetDirListing( sDir + "/*.mp3", arrayFiles ); GetDirListing( sDir + "/*.ogg", arrayFiles ); GetDirListing( sDir + "/*.wav", arrayFiles ); @@ -130,7 +130,7 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName ) return; /* the group is already added */ // Look for a group banner in this group folder - CStringArray arrayGroupBanners; + vector arrayGroupBanners; GetDirListing( sDir+sGroupDirName+"/*.png", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.jpg", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.gif", arrayGroupBanners ); @@ -163,7 +163,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) sDir += "/"; // Find all group directories in "Songs" folder - CStringArray arrayGroupDirs; + vector arrayGroupDirs; GetDirListing( sDir+"*", arrayGroupDirs, true ); SortCStringArray( arrayGroupDirs ); StripCvs( arrayGroupDirs ); @@ -175,7 +175,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) SanityCheckGroupDir(sDir+sGroupDirName); // Find all Song folders in this group directory - CStringArray arraySongDirs; + vector arraySongDirs; GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true ); StripCvs( arraySongDirs ); SortCStringArray( arraySongDirs ); @@ -229,7 +229,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder) { // Find all symlink files in this folder - CStringArray arraySymLinks; + vector arraySymLinks; GetDirListing( sDir+sGroupFolder+"/*.include", arraySymLinks, false ); SortCStringArray( arraySymLinks ); for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song. @@ -319,7 +319,7 @@ CString SongManager::GetSongGroupBannerPath( CString sSongGroup ) return CString(); } -void SongManager::GetSongGroupNames( CStringArray &AddTo ) +void SongManager::GetSongGroupNames( vector &AddTo ) { AddTo.insert(AddTo.end(), m_sSongGroupNames.begin(), m_sSongGroupNames.end() ); } @@ -393,7 +393,7 @@ CString SongManager::GetCourseGroupBannerPath( const CString &sCourseGroup ) } } -void SongManager::GetCourseGroupNames( CStringArray &AddTo ) +void SongManager::GetCourseGroupNames( vector &AddTo ) { FOREACHM_CONST( CString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) AddTo.push_back( iter->first ); @@ -504,7 +504,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld ) // Load courses from in Courses dir // { - CStringArray saCourseFiles; + vector saCourseFiles; GetDirListing( COURSES_DIR+"*.crs", saCourseFiles, false, true ); for( unsigned i=0; i vsCoursePaths; GetDirListing( COURSES_DIR + *sCourseGroup + "/*.crs", vsCoursePaths, false, true ); SortCStringArray( vsCoursePaths ); @@ -562,7 +562,7 @@ void SongManager::InitAutogenCourses() // // Create group courses for Endless and Nonstop // - CStringArray saGroupNames; + vector saGroupNames; this->GetSongGroupNames( saGroupNames ); Course* pCourse; for( unsigned g=0; g bits; split( sPath, "/", bits ); if( bits.size() == 1 ) @@ -1270,7 +1270,7 @@ void SongManager::UpdateRankingCourses() { /* Updating the ranking courses data is fairly expensive * since it involves comparing strings. Do so sparingly. */ - CStringArray RankingCourses; + vector RankingCourses; split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses); for( unsigned i=0; i < m_pCourses.size(); i++ ) @@ -1309,7 +1309,7 @@ void SongManager::LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot // CString sDir = sProfileDir + EDIT_STEPS_SUBDIR; - CStringArray vsFiles; + vector vsFiles; GetDirListing( sDir+"*.edit", vsFiles, false, true ); int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); @@ -1329,7 +1329,7 @@ void SongManager::LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot // CString sDir = sProfileDir + EDIT_COURSES_SUBDIR; - CStringArray vsFiles; + vector vsFiles; GetDirListing( sDir+"*.crs", vsFiles, false, true ); int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index be2af432d7..b1aeaf59c7 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -57,13 +57,13 @@ public: void PreloadSongImages(); CString GetSongGroupBannerPath( CString sSongGroup ); - void GetSongGroupNames( CStringArray &AddTo ); + void GetSongGroupNames( vector &AddTo ); bool DoesSongGroupExist( CString sSongGroup ); RageColor GetSongGroupColor( const CString &sSongGroupName ); RageColor GetSongColor( const Song* pSong ); CString GetCourseGroupBannerPath( const CString &sCourseGroup ); - void GetCourseGroupNames( CStringArray &AddTo ); + void GetCourseGroupNames( vector &AddTo ); bool DoesCourseGroupExist( const CString &sCourseGroup ); RageColor GetCourseGroupColor( const CString &sCourseGroupName ); RageColor GetCourseColor( const Course* pCourse ); @@ -129,8 +129,8 @@ protected: vector m_pSongs; // all songs that can be played vector m_pBestSongs[NUM_ProfileSlot]; vector m_pShuffledSongs; // used by GetRandomSong - CStringArray m_sSongGroupNames; - CStringArray m_sSongGroupBannerPaths; // each song group may have a banner associated with it + vector m_sSongGroupNames; + vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it vector m_pCourses; vector m_pBestCourses[NUM_ProfileSlot][NUM_CourseType]; diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index b4aab4bf19..866e64314b 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -74,7 +74,7 @@ void SongOptions::FromString( CString sOptions ) { // Init(); sOptions.MakeLower(); - CStringArray asBits; + vector asBits; split( sOptions, ",", asBits, true ); for( unsigned i=0; i asParts; split( sBit, " ", asParts, true ); bool on = true; if( asParts.size() > 1 ) diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index 6a8105025b..f7a8f3c892 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -1311,9 +1311,6 @@ struct StdStringEqualsNoCaseA #pragma warning (pop) #endif -#define CString CStdString -#define CStringArray vector - #endif // #ifndef STDSTRING_H /* diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 5a4839a203..60bc83b305 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -722,7 +722,7 @@ RageDisplay *CreateDisplay() VIDEO_TROUBLESHOOTING_URL "\n\n" "Video Driver: "+GetVideoDriverName()+"\n\n"; - CStringArray asRenderers; + vector asRenderers; split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true ); if( asRenderers.empty() ) @@ -982,14 +982,14 @@ int main(int argc, char* argv[]) /* Set up alternative filesystem trees. */ if( PREFSMAN->m_sAdditionalFolders.Get() != "" ) { - CStringArray dirs; + vector dirs; split( PREFSMAN->m_sAdditionalFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "/" ); } if( PREFSMAN->m_sAdditionalSongFolders.Get() != "" ) { - CStringArray dirs; + vector dirs; split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "/Songs" ); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 767dbad255..cdb9a42671 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -113,7 +113,7 @@ ThemeManager::ThemeManager() /* We don't have any theme loaded until SwitchThemeAndLanguage is called. */ m_sCurThemeName = ""; - CStringArray arrayThemeNames; + vector arrayThemeNames; GetThemeNames( arrayThemeNames ); } @@ -123,7 +123,7 @@ ThemeManager::~ThemeManager() SAFE_DELETE( g_pIniMetrics ); } -void ThemeManager::GetThemeNames( CStringArray& AddTo ) +void ThemeManager::GetThemeNames( vector& AddTo ) { GetDirListing( THEMES_DIR + "*", AddTo, true ); StripCvs( AddTo ); @@ -131,7 +131,7 @@ void ThemeManager::GetThemeNames( CStringArray& AddTo ) bool ThemeManager::DoesThemeExist( const CString &sThemeName ) { - CStringArray asThemeNames; + vector asThemeNames; GetThemeNames( asThemeNames ); for( unsigned i=0; i& AddTo ) { AddTo.clear(); @@ -150,13 +150,13 @@ void ThemeManager::GetLanguages( CStringArray& AddTo ) // remove dupes sort( AddTo.begin(), AddTo.end() ); - CStringArray::iterator it = unique( AddTo.begin(), AddTo.end() ); + vector::iterator it = unique( AddTo.begin(), AddTo.end() ); AddTo.erase(it, AddTo.end()); } bool ThemeManager::DoesLanguageExist( const CString &sLanguage ) { - CStringArray asLanguages; + vector asLanguages; GetLanguages( asLanguages ); for( unsigned i=0; isThemeName ); - CStringArray asElementPaths; + vector asElementPaths; GetDirListing( sThemeDir + "Scripts/" + sMask, asElementPaths, false, true ); for( unsigned i = 0; i < asElementPaths.size(); ++i ) { @@ -401,7 +401,7 @@ try_element_again: const CString sThemeDir = GetThemeDirFromName( sThemeName ); const CString &sCategory = ElementCategoryToString(category); - CStringArray asElementPaths; + vector asElementPaths; // If sFileName already has an extension, we're looking for a specific file bool bLookingForSpecificFile = sElement.find_last_of('.') != sElement.npos; @@ -412,7 +412,7 @@ try_element_again: } else // look for all files starting with sFileName that have types we can use { - CStringArray asPaths; + vector asPaths; GetDirListing( sThemeDir + sCategory + "/" + ClassAndElementToFileName(sClassName,sElement) + "*", asPaths, false, true ); @@ -844,7 +844,7 @@ apActorCommands ThemeManager::GetMetricA( const CString &sClassName, const CStri void ThemeManager::NextTheme() { - CStringArray as; + vector as; GetThemeNames( as ); unsigned i; for( i=0; i& asLanguagesOut ) { CString sLanguageDir = GetThemeDirFromName(sThemeName) + LANGUAGES_SUBDIR; - CStringArray as; + vector as; GetDirListing( sLanguageDir + "*.ini", as ); // stip out metrics.ini diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index cdbbe48669..9dd9d3e1fd 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -34,9 +34,9 @@ public: ThemeManager(); ~ThemeManager(); - void GetThemeNames( CStringArray& AddTo ); + void GetThemeNames( vector& AddTo ); bool DoesThemeExist( const CString &sThemeName ); - void GetLanguages( CStringArray& AddTo ); + void GetLanguages( vector& AddTo ); bool DoesLanguageExist( const CString &sLanguage ); void SwitchThemeAndLanguage( const CString &sThemeName, const CString &sLanguage ); void UpdateLuaGlobals(); @@ -103,7 +103,7 @@ protected: static CString GetThemeDirFromName( const CString &sThemeName ); CString GetElementDir( const CString &sThemeName ); static CString GetMetricsIniPath( const CString &sThemeName ); - static void GetLanguagesForTheme( const CString &sThemeName, CStringArray& asLanguagesOut ); + static void GetLanguagesForTheme( const CString &sThemeName, vector& asLanguagesOut ); static CString GetLanguageIniPath( const CString &sThemeName, const CString &sLanguage ); CString GetDefaultLanguage(); diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index 786596c0af..8a49942052 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -295,7 +295,7 @@ void UnlockManager::Load() { LOG->Trace( "UnlockManager::Load()" ); - CStringArray asUnlockNames; + vector asUnlockNames; split( UNLOCK_NAMES, ",", asUnlockNames ); if( asUnlockNames.empty() ) return; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp index 1b856cd5cd..2526a09566 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -415,7 +415,7 @@ void ArchHooks_Win32::MountInitialFilesystems( const CString &sDirOfExecutable ) { /* All Windows data goes in the directory one level above the executable. */ CHECKPOINT_M( ssprintf( "DOE \"%s\"", sDirOfExecutable.c_str()) ); - CStringArray parts; + vector parts; split( sDirOfExecutable, "/", parts ); CHECKPOINT_M( ssprintf( "... %i parts", parts.size()) ); ASSERT_M( parts.size() > 1, ssprintf("Strange sDirOfExecutable: %s", sDirOfExecutable.c_str()) ); diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp index 2c445b93a5..f15758b10a 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp @@ -293,7 +293,7 @@ void ArchHooks_darwin::MountInitialFilesystems( const CString &sDirOfExecutable { #if defined(MACOSX) CHECKPOINT_M( ssprintf("DOE \"%s\"", sDirOfExecutable.c_str()) ); - CStringArray parts; + vector parts; split( sDirOfExecutable, "/", parts ); ASSERT( parts.size() > 3 ); CString Dir = '/' + join( "/", parts.begin(), parts.end()-3 ); diff --git a/stepmania/src/arch/Dialog/Dialog.cpp b/stepmania/src/arch/Dialog/Dialog.cpp index e91ff88839..3bd7fc5e06 100644 --- a/stepmania/src/arch/Dialog/Dialog.cpp +++ b/stepmania/src/arch/Dialog/Dialog.cpp @@ -11,7 +11,7 @@ DialogDriver *MakeDialogDriver() { CString sDrivers = "win32,cocoa,null"; - CStringArray asDriversToTry; + vector asDriversToTry; split( sDrivers, ",", asDriversToTry, true ); ASSERT( asDriversToTry.size() != 0 ); diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index c6c1a50815..320a89cbef 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -136,7 +136,7 @@ void LoadingWindow_Win32::Paint() void LoadingWindow_Win32::SetText( CString sText ) { - CStringArray asMessageLines; + vector asMessageLines; split( sText, "\n", asMessageLines, false ); while( asMessageLines.size() < 3 ) asMessageLines.push_back( "" ); diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index db6e8f2718..063a8de880 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -13,7 +13,7 @@ #include "InputHandler/Selector_InputHandler.h" void MakeInputHandlers(CString drivers, vector &Add) { - CStringArray DriversToTry; + vector DriversToTry; split(drivers, ",", DriversToTry, true); ASSERT( DriversToTry.size() != 0 ); @@ -100,7 +100,7 @@ LoadingWindow *MakeLoadingWindow() /* Don't load NULL by default. On most systems, if we can't load the SDL * loading window, we won't be able to init OpenGL, either, so don't bother. */ CString drivers = "xbox,win32,cocoa,gtk"; - CStringArray DriversToTry; + vector DriversToTry; split(drivers, ",", DriversToTry, true); ASSERT( DriversToTry.size() != 0 ); @@ -180,7 +180,7 @@ RageMovieTexture *MakeRageMovieTexture(RageTextureID ID) { DumpAVIDebugInfo( ID.filename ); - CStringArray DriversToTry; + vector DriversToTry; split(PREFSMAN->GetMovieDrivers(), ",", DriversToTry, true); ASSERT(DriversToTry.size() != 0); @@ -227,7 +227,7 @@ RageMovieTexture *MakeRageMovieTexture(RageTextureID ID) #include "Sound/Selector_RageSoundDriver.h" RageSoundDriver *MakeRageSoundDriver(CString drivers) { - CStringArray DriversToTry; + vector DriversToTry; split(drivers, ",", DriversToTry, true); ASSERT( DriversToTry.size() != 0 ); diff --git a/stepmania/src/archutils/Unix/BacktraceNames.cpp b/stepmania/src/archutils/Unix/BacktraceNames.cpp index 6bb49a5e00..4861956304 100644 --- a/stepmania/src/archutils/Unix/BacktraceNames.cpp +++ b/stepmania/src/archutils/Unix/BacktraceNames.cpp @@ -397,7 +397,7 @@ void BacktraceNames::FromAddr( const void *p ) fprintf(stderr, "FromAddr read() failed: %s\n", strerror(errno)); return; } - CStringArray mangledAndFile; + vector mangledAndFile; split(f, " ", mangledAndFile, true); if (mangledAndFile.size() == 0) diff --git a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp index 7f8263473e..f5f9c89fee 100644 --- a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp +++ b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp @@ -232,7 +232,7 @@ static void child_process() if( !child_read(3, temp, size) ) return; - CStringArray Checkpoints; + vector Checkpoints; split(temp, "$$", Checkpoints); delete [] temp; diff --git a/stepmania/src/archutils/Win32/RegistryAccess.cpp b/stepmania/src/archutils/Win32/RegistryAccess.cpp index 7fc64effc9..9a97aa25c4 100644 --- a/stepmania/src/archutils/Win32/RegistryAccess.cpp +++ b/stepmania/src/archutils/Win32/RegistryAccess.cpp @@ -78,7 +78,7 @@ bool RegistryAccess::GetRegValue( const CString &sKey, const CString &sName, CSt return true; } -bool RegistryAccess::GetRegValue( const CString &sKey, CString sName, int &iVal ) +bool RegistryAccess::GetRegValue( const CString &sKey, const CString &sName, int &iVal ) { HKEY hKey = OpenRegKey( sKey ); if( hKey == NULL ) diff --git a/stepmania/src/global.h b/stepmania/src/global.h index 0881a665d6..e155ef84b0 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -135,6 +135,8 @@ void ShowWarning( const char *file, int line, const char *message ); // don't pu /* Use CStdString: */ #include "StdString.h" using namespace StdString; +//#define CString CStdString +typedef StdString::CStdString CString; /* Include this here to make sure our assertion handler is always * used. (This file is a dependency of most everything anyway,