From ec3f48cafccc4a7f4ba97368b02d838c2b6799a5 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 26 Jun 2014 11:42:46 +0200 Subject: [PATCH] [stdstring] get rid of CStdString in xbmc/ --- xbmc/AppParamParser.cpp | 2 +- xbmc/AppParamParser.h | 3 +- xbmc/Application.cpp | 111 ++++++----- xbmc/Application.h | 20 +- xbmc/ApplicationMessenger.cpp | 18 +- xbmc/ApplicationMessenger.h | 17 +- xbmc/Autorun.cpp | 41 +++-- xbmc/Autorun.h | 13 +- xbmc/DynamicDll.cpp | 4 +- xbmc/DynamicDll.h | 10 +- xbmc/GUIInfoManager.cpp | 286 ++++++++++++++--------------- xbmc/GUIInfoManager.h | 78 ++++---- xbmc/GUILargeTextureManager.cpp | 14 +- xbmc/GUILargeTextureManager.h | 16 +- xbmc/GUIPassword.cpp | 42 ++--- xbmc/GUIPassword.h | 16 +- xbmc/GUIUserMessages.h | 4 +- xbmc/MediaSource.cpp | 6 +- xbmc/MediaSource.h | 16 +- xbmc/NfoFile.cpp | 4 +- xbmc/NfoFile.h | 6 +- xbmc/PartyModeManager.cpp | 60 +++--- xbmc/PartyModeManager.h | 15 +- xbmc/PasswordManager.cpp | 18 +- xbmc/PasswordManager.h | 11 +- xbmc/PlayListPlayer.cpp | 2 +- xbmc/SectionLoader.cpp | 13 +- xbmc/SectionLoader.h | 9 +- xbmc/Temperature.cpp | 75 ++++---- xbmc/TextureCache.cpp | 68 +++---- xbmc/TextureCache.h | 39 ++-- xbmc/TextureCacheJob.cpp | 18 +- xbmc/TextureCacheJob.h | 23 +-- xbmc/TextureDatabase.cpp | 50 ++--- xbmc/TextureDatabase.h | 26 +-- xbmc/ThumbLoader.cpp | 14 +- xbmc/ThumbLoader.h | 8 +- xbmc/filesystem/DAVFile.cpp | 2 +- xbmc/filesystem/DllLibCurl.h | 2 + xbmc/network/upnp/UPnP.cpp | 4 +- xbmc/network/upnp/UPnPRenderer.cpp | 4 +- xbmc/test/TestBasicEnvironment.cpp | 6 +- xbmc/utils/EdenVideoArtUpdater.h | 1 + xbmc/utils/FileOperationJob.h | 1 + xbmc/utils/FileUtils.h | 1 + 45 files changed, 605 insertions(+), 592 deletions(-) diff --git a/xbmc/AppParamParser.cpp b/xbmc/AppParamParser.cpp index 10e854078556c..491f7a8e70ca5 100644 --- a/xbmc/AppParamParser.cpp +++ b/xbmc/AppParamParser.cpp @@ -119,7 +119,7 @@ void CAppParamParser::EnableDebugMode() CLog::SetLogLevel(g_advancedSettings.m_logLevel); } -void CAppParamParser::ParseArg(const CStdString &arg) +void CAppParamParser::ParseArg(const std::string &arg) { if (arg == "-fs" || arg == "--fullscreen") g_advancedSettings.m_startFullScreen = true; diff --git a/xbmc/AppParamParser.h b/xbmc/AppParamParser.h index 78d6174b6f4a7..ee88dbf47fc8a 100644 --- a/xbmc/AppParamParser.h +++ b/xbmc/AppParamParser.h @@ -18,7 +18,6 @@ * */ -#include "utils/StdString.h" #include "FileItem.h" class CAppParamParser @@ -30,7 +29,7 @@ class CAppParamParser private: bool m_testmode; CFileItemList m_playlist; - void ParseArg(const CStdString &arg); + void ParseArg(const std::string &arg); void DisplayHelp(); void DisplayVersion(); void EnableDebugMode(); diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index e91b82b9aa6e4..17e065f6368cc 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -565,13 +565,13 @@ extern "C" void __stdcall cleanup_emu_environ(); // Utility function used to copy files from the application bundle // over to the user data directory in Application Support/Kodi. // -static void CopyUserDataIfNeeded(const CStdString &strPath, const CStdString &file) +static void CopyUserDataIfNeeded(const std::string &strPath, const std::string &file) { - CStdString destPath = URIUtils::AddFileToFolder(strPath, file); + std::string destPath = URIUtils::AddFileToFolder(strPath, file); if (!CFile::Exists(destPath)) { // need to copy it across - CStdString srcPath = URIUtils::AddFileToFolder("special://xbmc/userdata/", file); + std::string srcPath = URIUtils::AddFileToFolder("special://xbmc/userdata/", file); CFile::Copy(srcPath, destPath); } } @@ -586,7 +586,7 @@ void CApplication::Preflight() // run any platform preflight scripts. #if defined(TARGET_DARWIN_OSX) - CStdString install_path; + std::string install_path; CUtil::GetHomePath(install_path); setenv("KODI_HOME", install_path.c_str(), 0); @@ -732,7 +732,7 @@ bool CApplication::Create() #endif CSpecialProtocol::LogPaths(); - CStdString executable = CUtil::ResolveExecutablePath(); + std::string executable = CUtil::ResolveExecutablePath(); CLog::Log(LOGNOTICE, "The executable running is: %s", executable.c_str()); CLog::Log(LOGNOTICE, "Local hostname: %s", m_network->GetHostName().c_str()); std::string lowerAppName = CCompileInfo::GetAppName(); @@ -741,7 +741,7 @@ bool CApplication::Create() CRegExp::LogCheckUtf8Support(); CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------"); - CStdString strExecutablePath; + std::string strExecutablePath; CUtil::GetHomePath(strExecutablePath); #ifdef HAS_XRANDR @@ -803,17 +803,17 @@ bool CApplication::Create() update_emu_environ();//apply the GUI settings // Load the langinfo to have user charset <-> utf-8 conversion - CStdString strLanguage = CSettings::Get().GetString("locale.language"); + std::string strLanguage = CSettings::Get().GetString("locale.language"); strLanguage[0] = toupper(strLanguage[0]); - CStdString strLangInfoPath = StringUtils::Format("special://xbmc/language/%s/langinfo.xml", strLanguage.c_str()); + std::string strLangInfoPath = StringUtils::Format("special://xbmc/language/%s/langinfo.xml", strLanguage.c_str()); CLog::Log(LOGINFO, "load language info file: %s", strLangInfoPath.c_str()); g_langInfo.Load(strLangInfoPath); g_langInfo.SetAudioLanguage(CSettings::Get().GetString("locale.audiolanguage")); g_langInfo.SetSubtitleLanguage(CSettings::Get().GetString("locale.subtitlelanguage")); - CStdString strLanguagePath = "special://xbmc/language/"; + std::string strLanguagePath = "special://xbmc/language/"; CLog::Log(LOGINFO, "load %s language file, from path: %s", strLanguage.c_str(), strLanguagePath.c_str()); if (!g_localizeStrings.Load(strLanguagePath, strLanguage)) @@ -979,7 +979,7 @@ bool CApplication::CreateGUI() if (g_advancedSettings.m_splashImage) { - CStdString strUserSplash = "special://home/media/Splash.png"; + std::string strUserSplash = "special://home/media/Splash.png"; if (CFile::Exists(strUserSplash)) { CLog::Log(LOGINFO, "load user splash image: %s", CSpecialProtocol::TranslatePath(strUserSplash).c_str()); @@ -1089,7 +1089,6 @@ bool CApplication::InitDirectoriesLinux() const char* envAppBinHome = "KODI_BIN_HOME"; const char* envAppTemp = "KODI_TEMP"; - CUtil::GetHomePath(appBinPath, envAppBinHome); if (getenv(envAppHome)) appPath = getenv(envAppHome); @@ -1122,7 +1121,7 @@ bool CApplication::InitDirectoriesLinux() CSpecialProtocol::SetHomePath(userHome + "/" + dotLowerAppName); CSpecialProtocol::SetMasterProfilePath(userHome + "/" + dotLowerAppName + "/userdata"); - CStdString strTempPath = userHome; + std::string strTempPath = userHome; strTempPath = URIUtils::AddFileToFolder(strTempPath, dotLowerAppName + "/temp"); if (getenv(envAppTemp)) strTempPath = getenv(envAppTemp); @@ -1144,7 +1143,7 @@ bool CApplication::InitDirectoriesLinux() CSpecialProtocol::SetHomePath(URIUtils::AddFileToFolder(appPath, "portable_data")); CSpecialProtocol::SetMasterProfilePath(URIUtils::AddFileToFolder(appPath, "portable_data/userdata")); - CStdString strTempPath = appPath; + std::string strTempPath = appPath; strTempPath = URIUtils::AddFileToFolder(strTempPath, "portable_data/temp"); if (getenv(envAppTemp)) strTempPath = getenv(envAppTemp); @@ -1164,7 +1163,7 @@ bool CApplication::InitDirectoriesLinux() bool CApplication::InitDirectoriesOSX() { #if defined(TARGET_DARWIN) - CStdString userName; + std::string userName; if (getenv("USER")) userName = getenv("USER"); else @@ -1181,13 +1180,13 @@ bool CApplication::InitDirectoriesOSX() setenv("KODI_HOME", appPath.c_str(), 0); #if defined(TARGET_DARWIN_IOS) - CStdString fontconfigPath; + std::string fontconfigPath; fontconfigPath = appPath + "/system/players/dvdplayer/etc/fonts/fonts.conf"; setenv("FONTCONFIG_FILE", fontconfigPath.c_str(), 0); #endif // setup path to our internal dylibs so loader can find them - CStdString frameworksPath = CUtil::GetFrameworksPath(); + std::string frameworksPath = CUtil::GetFrameworksPath(); CSpecialProtocol::SetXBMCFrameworksPath(frameworksPath); // OSX always runs with m_bPlatformDirectories == true @@ -1239,7 +1238,7 @@ bool CApplication::InitDirectoriesOSX() CSpecialProtocol::SetHomePath(URIUtils::AddFileToFolder(appPath, "portable_data")); CSpecialProtocol::SetMasterProfilePath(URIUtils::AddFileToFolder(appPath, "portable_data/userdata")); - CStdString strTempPath = URIUtils::AddFileToFolder(appPath, "portable_data/temp"); + std::string strTempPath = URIUtils::AddFileToFolder(appPath, "portable_data/temp"); CSpecialProtocol::SetTempPath(strTempPath); URIUtils::AddSlashAtEnd(strTempPath); @@ -1255,14 +1254,14 @@ bool CApplication::InitDirectoriesOSX() bool CApplication::InitDirectoriesWin32() { #ifdef TARGET_WINDOWS - CStdString xbmcPath; + std::string xbmcPath; CUtil::GetHomePath(xbmcPath); CEnvironment::setenv("KODI_HOME", xbmcPath); CSpecialProtocol::SetXBMCBinPath(xbmcPath); CSpecialProtocol::SetXBMCPath(xbmcPath); - CStdString strWin32UserFolder = CWIN32Util::GetProfilePath(); + std::string strWin32UserFolder = CWIN32Util::GetProfilePath(); g_advancedSettings.m_logFolder = strWin32UserFolder; CSpecialProtocol::SetHomePath(strWin32UserFolder); @@ -1660,7 +1659,7 @@ void CApplication::OnSettingChanged(const CSetting *setting) else if (settingId == "lookandfeel.skintheme") { // also set the default color theme - CStdString colorTheme = ((CSettingString*)setting)->GetValue(); + std::string colorTheme = ((CSettingString*)setting)->GetValue(); URIUtils::RemoveExtension(colorTheme); if (StringUtils::EqualsNoCase(colorTheme, "Textures")) colorTheme = "defaults"; @@ -1906,7 +1905,7 @@ bool CApplication::Save(TiXmlNode *settings) const return true; } -bool CApplication::LoadSkin(const CStdString& skinID) +bool CApplication::LoadSkin(const std::string& skinID) { AddonPtr addon; if (CAddonMgr::Get().GetAddon(skinID, addon, ADDON_SKIN)) @@ -1969,7 +1968,7 @@ bool CApplication::LoadSkin(const SkinPtr& skin) g_fontManager.LoadFonts(CSettings::Get().GetString("lookandfeel.font")); // load in the skin strings - CStdString langPath = URIUtils::AddFileToFolder(skin->Path(), "language"); + std::string langPath = URIUtils::AddFileToFolder(skin->Path(), "language"); URIUtils::AddSlashAtEnd(langPath); g_localizeStrings.LoadSkinStrings(langPath, CSettings::Get().GetString("locale.language")); @@ -2087,7 +2086,7 @@ bool CApplication::LoadUserWindows() { if (items[i]->m_bIsFolder) continue; - CStdString skinFile = URIUtils::GetFileName(items[i]->GetPath()); + std::string skinFile = URIUtils::GetFileName(items[i]->GetPath()); if (StringUtils::StartsWithNoCase(skinFile, "custom")) { CXBMCTinyXML xmlDoc; @@ -2099,8 +2098,8 @@ bool CApplication::LoadUserWindows() // Root element should be TiXmlElement* pRootElement = xmlDoc.RootElement(); - CStdString strValue = pRootElement->Value(); - if (!strValue.Equals("window")) + std::string strValue = pRootElement->Value(); + if (!StringUtils::CompareNoCase(strValue, "window")) { CLog::Log(LOGERROR, "file: %s doesnt contain ", skinFile.c_str()); continue; @@ -2109,7 +2108,7 @@ bool CApplication::LoadUserWindows() // Read the element to get the window type to create // If no type is specified, create a CGUIWindow as default CGUIWindow* pWindow = NULL; - CStdString strType; + std::string strType; if (pRootElement->Attribute("type")) strType = pRootElement->Attribute("type"); else @@ -2125,14 +2124,14 @@ bool CApplication::LoadUserWindows() if (pType && pType->FirstChild()) id = atol(pType->FirstChild()->Value()); } - CStdString visibleCondition; + std::string visibleCondition; CGUIControlFactory::GetConditionalVisibility(pRootElement, visibleCondition); - if (strType.Equals("dialog")) + if (StringUtils::EqualsNoCase(strType, "dialog")) pWindow = new CGUIDialog(id + WINDOW_HOME, skinFile); - else if (strType.Equals("submenu")) + else if (StringUtils::EqualsNoCase(strType, "submenu")) pWindow = new CGUIDialogSubMenu(id + WINDOW_HOME, skinFile); - else if (strType.Equals("buttonmenu")) + else if (StringUtils::EqualsNoCase(strType, "buttonmenu")) pWindow = new CGUIDialogButtonMenu(id + WINDOW_HOME, skinFile); else pWindow = new CGUIWindow(id + WINDOW_HOME, skinFile); @@ -2969,7 +2968,7 @@ bool CApplication::ProcessGamepad(float frameTime) } int actionID; - CStdString actionName; + std::string actionName; bool fullrange; keymapId = joyId + 1; if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joyName, keymapId, JACTIVE_BUTTON, actionID, actionName, fullrange)) @@ -2988,7 +2987,7 @@ bool CApplication::ProcessGamepad(float frameTime) } int actionID; - CStdString actionName; + std::string actionName; bool fullrange; if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joyName, keymapId, JACTIVE_AXIS, actionID, actionName, fullrange)) { @@ -3019,7 +3018,7 @@ bool CApplication::ProcessGamepad(float frameTime) } int actionID; - CStdString actionName; + std::string actionName; bool fullrange; keymapId = position << 16 | keymapId; @@ -3239,7 +3238,7 @@ bool CApplication::ProcessJoystickEvent(const std::string& joystickName, int wKe int iWin = GetActiveWindowID(); int actionID; - CStdString actionName; + std::string actionName; bool fullRange = false; // Translate using regular joystick translator. @@ -3702,7 +3701,7 @@ PlayBackRet CApplication::PlayStack(const CFileItem& item, bool bRestart) if (dbs.Open()) { CBookmark bookmark; - CStdString path = item.GetPath(); + std::string path = item.GetPath(); if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString())) path = item.GetProperty("original_listitem_url").asString(); if( dbs.GetResumeBookMark(path, bookmark) ) @@ -3790,7 +3789,7 @@ PlayBackRet CApplication::PlayStack(const CFileItem& item, bool bRestart) { // can only resume seek here, not dvdstate CBookmark bookmark; - CStdString path = item.GetPath(); + std::string path = item.GetPath(); if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString())) path = item.GetProperty("original_listitem_url").asString(); if( dbs.GetResumeBookMark(path, bookmark) ) @@ -3967,7 +3966,7 @@ PlayBackRet CApplication::PlayFile(const CFileItem& item, bool bRestart) { options.starttime = 0.0f; CBookmark bookmark; - CStdString path = item.GetPath(); + std::string path = item.GetPath(); if (item.HasVideoInfoTag() && StringUtils::StartsWith(item.GetVideoInfoTag()->m_strFileNameAndPath, "removable://")) path = item.GetVideoInfoTag()->m_strFileNameAndPath; else if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString())) @@ -5069,7 +5068,7 @@ void CApplication::Process() m_loggingIn = false; // autoexec.py - profile - CStdString strAutoExecPy = CSpecialProtocol::TranslatePath("special://profile/autoexec.py"); + std::string strAutoExecPy = CSpecialProtocol::TranslatePath("special://profile/autoexec.py"); if (XFILE::CFile::Exists(strAutoExecPy)) CScriptInvocationManager::Get().Execute(strAutoExecPy); @@ -5277,7 +5276,7 @@ void CApplication::Restart(bool bSamePosition) double time = GetTime(); // get player state, needed for dvd's - CStdString state = m_pPlayer->GetPlayerState(); + std::string state = m_pPlayer->GetPlayerState(); // set the requested starttime m_itemCurrentFile->m_lStartOffset = (long)(time * 75.0); @@ -5657,7 +5656,7 @@ void CApplication::StartVideoCleanup(bool userInitiated /* = true */) } } -void CApplication::StartVideoScan(const CStdString &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) +void CApplication::StartVideoScan(const std::string &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) { if (m_videoInfoScanner->IsScanning()) return; @@ -5681,7 +5680,7 @@ void CApplication::StartMusicCleanup(bool userInitiated /* = true */) } } -void CApplication::StartMusicScan(const CStdString &strDirectory, bool userInitiated /* = true */, int flags /* = 0 */) +void CApplication::StartMusicScan(const std::string &strDirectory, bool userInitiated /* = true */, int flags /* = 0 */) { if (m_musicInfoScanner->IsScanning()) return; @@ -5700,7 +5699,7 @@ void CApplication::StartMusicScan(const CStdString &strDirectory, bool userIniti m_musicInfoScanner->Start(strDirectory, flags); } -void CApplication::StartMusicAlbumScan(const CStdString& strDirectory, +void CApplication::StartMusicAlbumScan(const std::string& strDirectory, bool refresh) { if (m_musicInfoScanner->IsScanning()) @@ -5711,7 +5710,7 @@ void CApplication::StartMusicAlbumScan(const CStdString& strDirectory, m_musicInfoScanner->FetchAlbumInfo(strDirectory,refresh); } -void CApplication::StartMusicArtistScan(const CStdString& strDirectory, +void CApplication::StartMusicArtistScan(const std::string& strDirectory, bool refresh) { if (m_musicInfoScanner->IsScanning()) @@ -5746,7 +5745,7 @@ void CApplication::CheckPlayingProgress() } } -bool CApplication::ProcessAndStartPlaylist(const CStdString& strPlayList, CPlayList& playlist, int iPlaylist, int track) +bool CApplication::ProcessAndStartPlaylist(const std::string& strPlayList, CPlayList& playlist, int iPlaylist, int track) { CLog::Log(LOGDEBUG,"CApplication::ProcessAndStartPlaylist(%s, %i)",strPlayList.c_str(), iPlaylist); @@ -5786,20 +5785,20 @@ bool CApplication::AlwaysProcess(const CAction& action) // check if this button is mapped to a built-in function if (!action.GetName().empty()) { - CStdString builtInFunction; + std::string builtInFunction; vector params; CUtil::SplitExecFunction(action.GetName(), builtInFunction, params); StringUtils::ToLower(builtInFunction); // should this button be handled normally or just cancel the screensaver? - if ( builtInFunction.Equals("powerdown") - || builtInFunction.Equals("reboot") - || builtInFunction.Equals("restart") - || builtInFunction.Equals("restartapp") - || builtInFunction.Equals("suspend") - || builtInFunction.Equals("hibernate") - || builtInFunction.Equals("quit") - || builtInFunction.Equals("shutdown")) + if ( builtInFunction == "powerdown" + || builtInFunction == "reboot" + || builtInFunction == "restart" + || builtInFunction == "restartapp" + || builtInFunction == "suspend" + || builtInFunction == "hibernate" + || builtInFunction == "quit" + || builtInFunction == "shutdown") { return true; } @@ -5831,12 +5830,12 @@ CPerformanceStats &CApplication::GetPerformanceStats() } #endif -bool CApplication::SetLanguage(const CStdString &strLanguage) +bool CApplication::SetLanguage(const std::string &strLanguage) { - CStdString strPreviousLanguage = CSettings::Get().GetString("locale.language"); + std::string strPreviousLanguage = CSettings::Get().GetString("locale.language"); if (strLanguage != strPreviousLanguage) { - CStdString strLangInfoPath = StringUtils::Format("special://xbmc/language/%s/langinfo.xml", strLanguage.c_str()); + std::string strLangInfoPath = StringUtils::Format("special://xbmc/language/%s/langinfo.xml", strLanguage.c_str()); if (!g_langInfo.Load(strLangInfoPath)) return false; diff --git a/xbmc/Application.h b/xbmc/Application.h index 0a332ff9882cb..d7061450064a7 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h @@ -25,9 +25,9 @@ #include "guilib/IMsgTargetCallback.h" #include "utils/GlobalsHandling.h" -#include "utils/StdString.h" #include +#include class CAction; class CFileItem; @@ -174,7 +174,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs virtual void OnPlayBackSpeedChanged(int iSpeed); bool PlayMedia(const CFileItem& item, int iPlaylist = PLAYLIST_MUSIC); bool PlayMediaSync(const CFileItem& item, int iPlaylist = PLAYLIST_MUSIC); - bool ProcessAndStartPlaylist(const CStdString& strPlayList, PLAYLIST::CPlayList& playlist, int iPlaylist, int track=0); + bool ProcessAndStartPlaylist(const std::string& strPlayList, PLAYLIST::CPlayList& playlist, int iPlaylist, int track=0); PlayBackRet PlayFile(const CFileItem& item, bool bRestart = false); void SaveFileState(bool bForeground = false); void UpdateFileState(); @@ -257,7 +257,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs \param userInitiated Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. \param scanAll Whether to scan everything not already scanned (regardless of whether the user normally doesn't want a folder scanned). */ - void StartVideoScan(const CStdString &path, bool userInitiated = true, bool scanAll = false); + void StartVideoScan(const std::string &path, bool userInitiated = true, bool scanAll = false); /*! \brief Starts a music library cleanup. @@ -271,9 +271,9 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs \param userInitiated Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. \param flags Flags for controlling the scanning process. See xbmc/music/infoscanner/MusicInfoScanner.h for possible values. */ - void StartMusicScan(const CStdString &path, bool userInitiated = true, int flags = 0); - void StartMusicAlbumScan(const CStdString& strDirectory, bool refresh=false); - void StartMusicArtistScan(const CStdString& strDirectory, bool refresh=false); + void StartMusicScan(const std::string &path, bool userInitiated = true, int flags = 0); + void StartMusicAlbumScan(const std::string& strDirectory, bool refresh = false); + void StartMusicArtistScan(const std::string& strDirectory, bool refresh = false); void UpdateLibraries(); void CheckMusicPlaylist(); @@ -316,7 +316,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs CKaraokeLyricsManager* m_pKaraokeMgr; PLAYERCOREID m_eForcedNextPlayer; - CStdString m_strPlayListFile; + std::string m_strPlayListFile; int GlobalIdleTime(); @@ -374,7 +374,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs void SetRenderGUI(bool renderGUI); bool GetRenderGUI() const { return m_renderGUI; }; - bool SetLanguage(const CStdString &strLanguage); + bool SetLanguage(const std::string &strLanguage); ReplayGainSettings& GetReplayGainSettings() { return m_replayGainSettings; } @@ -390,7 +390,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs virtual void OnSettingAction(const CSetting *setting); virtual bool OnSettingUpdate(CSetting* &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode); - bool LoadSkin(const CStdString& skinID); + bool LoadSkin(const std::string& skinID); bool LoadSkin(const boost::shared_ptr& skin); bool m_skinReverting; @@ -431,7 +431,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs CFileItemList* m_currentStack; CFileItemPtr m_stackFileItemToUpdate; - CStdString m_prevMedia; + std::string m_prevMedia; CSplash* m_splash; ThreadIdentifier m_threadID; // application thread ID. Used in applicationMessanger to know where we are firing a thread with delay from. bool m_bInitializing; diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp index 2f4d6517bc453..08a2257e335e7 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp @@ -448,8 +448,8 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg) pSlideShow->Reset(); CFileItemList items; - CStdString strPath = pMsg->strParam; - CStdString extensions = g_advancedSettings.m_pictureExtensions; + std::string strPath = pMsg->strParam; + std::string extensions = g_advancedSettings.m_pictureExtensions; if (pMsg->param1) extensions += "|.tbn"; CUtil::GetRecursiveListing(strPath, items, extensions); @@ -891,7 +891,7 @@ void CApplicationMessenger::ProcessWindowMessages() } } -int CApplicationMessenger::SetResponse(CStdString response) +int CApplicationMessenger::SetResponse(std::string response) { CSingleLock lock (m_critBuffer); bufferResponse=response; @@ -899,16 +899,16 @@ int CApplicationMessenger::SetResponse(CStdString response) return 0; } -CStdString CApplicationMessenger::GetResponse() +std::string CApplicationMessenger::GetResponse() { - CStdString tmp; + std::string tmp; CSingleLock lock (m_critBuffer); tmp=bufferResponse; lock.Leave(); return tmp; } -void CApplicationMessenger::ExecBuiltIn(const CStdString &command, bool wait) +void CApplicationMessenger::ExecBuiltIn(const std::string &command, bool wait) { ThreadMessage tMsg = {TMSG_EXECUTE_BUILT_IN}; tMsg.strParam = command; @@ -1211,7 +1211,7 @@ void CApplicationMessenger::Minimize(bool wait) SendMessage(tMsg, wait); } -void CApplicationMessenger::DoModal(CGUIDialog *pDialog, int iWindowID, const CStdString ¶m) +void CApplicationMessenger::DoModal(CGUIDialog *pDialog, int iWindowID, const std::string ¶m) { ThreadMessage tMsg = {TMSG_GUI_DO_MODAL}; tMsg.lpVoid = pDialog; @@ -1220,7 +1220,7 @@ void CApplicationMessenger::DoModal(CGUIDialog *pDialog, int iWindowID, const CS SendMessage(tMsg, true); } -void CApplicationMessenger::ExecOS(const CStdString &command, bool waitExit) +void CApplicationMessenger::ExecOS(const std::string &command, bool waitExit) { ThreadMessage tMsg = {TMSG_EXECUTE_OS}; tMsg.strParam = command; @@ -1316,7 +1316,7 @@ void CApplicationMessenger::ShowVolumeBar(bool up) SendMessage(tMsg, false); } -void CApplicationMessenger::SetSplashMessage(const CStdString& message) +void CApplicationMessenger::SetSplashMessage(const std::string& message) { ThreadMessage tMsg = {TMSG_SPLASH_MESSAGE}; tMsg.strParam = message; diff --git a/xbmc/ApplicationMessenger.h b/xbmc/ApplicationMessenger.h index 543e0654c866b..ddbca6ced3607 100644 --- a/xbmc/ApplicationMessenger.h +++ b/xbmc/ApplicationMessenger.h @@ -20,7 +20,6 @@ * */ -#include "utils/StdString.h" #include "guilib/WindowIDs.h" #include "threads/Thread.h" #include @@ -120,7 +119,7 @@ typedef struct unsigned int dwMessage; int param1; int param2; - CStdString strParam; + std::string strParam; std::vector params; boost::shared_ptr waitEvent; void* lpVoid; @@ -208,7 +207,7 @@ class CApplicationMessenger void ActivateScreensaver(); void SwitchToFullscreen(); // void Minimize(bool wait = false); - void ExecOS(const CStdString &command, bool waitExit = false); + void ExecOS(const std::string &command, bool waitExit = false); void UserEvent(int code); //! \brief Set the tag for the currently playing song void SetCurrentSongTag(const MUSIC_INFO::CMusicInfoTag& tag); @@ -222,13 +221,13 @@ class CApplicationMessenger void CECActivateSource(); void CECStandby(); - CStdString GetResponse(); - int SetResponse(CStdString response); - void ExecBuiltIn(const CStdString &command, bool wait = false); + std::string GetResponse(); + int SetResponse(std::string response); + void ExecBuiltIn(const std::string &command, bool wait = false); void NetworkMessage(int dwMessage, int dwParam = 0); - void DoModal(CGUIDialog *pDialog, int iWindowID, const CStdString ¶m = ""); + void DoModal(CGUIDialog *pDialog, int iWindowID, const std::string ¶m = ""); void Show(CGUIDialog *pDialog); void Close(CGUIWindow *window, bool forceClose, bool waitResult = true, int nextWindowID = 0, bool enableSound = true); void ActivateWindow(int windowID, const std::vector ¶ms, bool swappingWindows); @@ -250,7 +249,7 @@ class CApplicationMessenger void ShowVolumeBar(bool up); - void SetSplashMessage(const CStdString& message); + void SetSplashMessage(const std::string& message); void SetSplashMessage(int stringID); bool SetupDisplay(); @@ -270,7 +269,7 @@ class CApplicationMessenger std::queue m_vecWindowMessages; CCriticalSection m_critSection; CCriticalSection m_critBuffer; - CStdString bufferResponse; + std::string bufferResponse; }; XBMC_GLOBAL_REF(CApplicationMessenger,s_messenger); diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp index dfe4cc0d238b9..bb98d3e723f2c 100644 --- a/xbmc/Autorun.cpp +++ b/xbmc/Autorun.cpp @@ -39,6 +39,7 @@ #include "storage/MediaManager.h" #include "video/VideoDatabase.h" #include "dialogs/GUIDialogYesNo.h" +#include "utils/StringUtils.h" #include "utils/URIUtils.h" #include "utils/log.h" #include "video/windows/GUIWindowVideoBase.h" @@ -59,7 +60,7 @@ CAutorun::CAutorun() CAutorun::~CAutorun() {} -void CAutorun::ExecuteAutorun(const CStdString& path, bool bypassSettings, bool ignoreplaying, bool startFromBeginning ) +void CAutorun::ExecuteAutorun(const std::string& path, bool bypassSettings, bool ignoreplaying, bool startFromBeginning ) { if ((!ignoreplaying && (g_application.m_pPlayer->IsPlayingAudio() || g_application.m_pPlayer->IsPlayingVideo() || g_windowManager.HasModalDialog())) || g_windowManager.GetActiveWindow() == WINDOW_LOGIN_SCREEN) return ; @@ -82,7 +83,7 @@ void CAutorun::ExecuteAutorun(const CStdString& path, bool bypassSettings, bool PlayDisc(path, bypassSettings, startFromBeginning); } -bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startFromBeginning) +bool CAutorun::PlayDisc(const std::string& path, bool bypassSettings, bool startFromBeginning) { if ( !bypassSettings && CSettings::Get().GetInt("audiocds.autoaction") != AUTOCD_PLAY && !CSettings::Get().GetBool("dvds.autorun")) return false; @@ -90,7 +91,7 @@ bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startF int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size(); int nAddedToPlaylist = 0; - CStdString mediaPath; + std::string mediaPath; CCdInfo* pInfo = g_mediaManager.GetCdInfo(path); if (pInfo == NULL) @@ -129,7 +130,7 @@ bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startF /** * This method tries to determine what type of disc is located in the given drive and starts to play the content appropriately. */ -bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings /* = false */, bool startFromBeginning /* = false */) +bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings /* = false */, bool startFromBeginning /* = false */) { bool bPlaying(false); CFileItemList vecItems; @@ -156,7 +157,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded // is this a root folder we have to check the content to determine a disc type if( bRoot ) { - CStdString hddvdname = ""; + std::string hddvdname = ""; CFileItemPtr phddvdItem; // check root folders next, for normal structured dvd's @@ -167,15 +168,15 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded // is the current item a (non system) folder? if (pItem->m_bIsFolder && pItem->GetPath() != "." && pItem->GetPath() != "..") { - CStdString name = pItem->GetPath(); + std::string name = pItem->GetPath(); URIUtils::RemoveSlashAtEnd(name); name = URIUtils::GetFileName(name); // Check if the current foldername indicates a DVD structure (name is "VIDEO_TS") - if (name.Equals("VIDEO_TS") && bAllowVideo + if (StringUtils::EqualsNoCase(name, "VIDEO_TS") && bAllowVideo && (bypassSettings || CSettings::Get().GetBool("dvds.autorun"))) { - CStdString path = URIUtils::AddFileToFolder(pItem->GetPath(), "VIDEO_TS.IFO"); + std::string path = URIUtils::AddFileToFolder(pItem->GetPath(), "VIDEO_TS.IFO"); if(!CFile::Exists(path)) path = URIUtils::AddFileToFolder(pItem->GetPath(), "video_ts.ifo"); CFileItemPtr item(new CFileItem(path, false)); @@ -196,7 +197,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded // Check if the current foldername indicates a Blu-Ray structure (default is "BDMV"). // A BR should also include an "AACS" folder for encryption, Sony-BRs can also include update folders for PS3 (PS3_UPDATE / PS3_VPRM). // ToDo: for the time beeing, the DVD autorun settings are used to determine if the BR should be started automatically. - if (name.Equals("BDMV") && bAllowVideo + if (StringUtils::EqualsNoCase(name, "BDMV") && bAllowVideo && (bypassSettings || CSettings::Get().GetBool("dvds.autorun"))) { CFileItemPtr item(new CFileItem(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false)); @@ -222,7 +223,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded CFileItemList items, sitems; // Advanced Content HD DVD (most discs?) - if (name.Equals("ADV_OBJ")) + if (StringUtils::EqualsNoCase(name, "ADV_OBJ")) { CLog::Log(LOGINFO,"HD DVD: Checking for playlist."); // find playlist file @@ -239,7 +240,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded } // Standard Content HD DVD (few discs?) - if (name.Equals("HVDVD_TS") && bAllowVideo + if (StringUtils::EqualsNoCase(name, "HVDVD_TS") && bAllowVideo && (bypassSettings || CSettings::Get().GetBool("dvds.autorun"))) { if (hddvdname == "") @@ -300,7 +301,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded item.m_lStartOffset = STARTOFFSET_RESUME; // get playername - CStdString hddvdplayer = CPlayerCoreFactory::Get().GetPlayerName(CPlayerCoreFactory::Get().GetDefaultPlayer(item)); + std::string hddvdplayer = CPlayerCoreFactory::Get().GetPlayerName(CPlayerCoreFactory::Get().GetDefaultPlayer(item)); // Single *.xpl or *.ifo files require an external player to handle playback. // If no matching rule was found, DVDPlayer will be default player. @@ -324,10 +325,10 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded } // Video CDs can have multiple file formats. First we need to determine which one is used on the CD - CStdString strExt; - if (name.Equals("MPEGAV")) + std::string strExt; + if (StringUtils::EqualsNoCase(name, "MPEGAV")) strExt = ".dat"; - if (name.Equals("MPEG2")) + if (StringUtils::EqualsNoCase(name, "MPEG2")) strExt = ".mpg"; // If a file format was extracted we are sure this is a VCD. Autoplay if settings indicate we should. @@ -351,7 +352,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded && (bypassSettings)) { bPlaying = true; - CStdString strExec = StringUtils::Format("RecursiveSlideShow(%s)", pItem->GetPath().c_str()); + std::string strExec = StringUtils::Format("RecursiveSlideShow(%s)", pItem->GetPath().c_str()); CBuiltins::Execute(strExec); return true; } @@ -428,7 +429,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded if (!pItem->m_bIsFolder && pItem->IsPicture()) { bPlaying = true; - CStdString strExec = StringUtils::Format("RecursiveSlideShow(%s)", strDrive.c_str()); + std::string strExec = StringUtils::Format("RecursiveSlideShow(%s)", strDrive.c_str()); CBuiltins::Execute(strExec); break; } @@ -491,14 +492,14 @@ bool CAutorun::IsEnabled() const return m_bEnable; } -bool CAutorun::PlayDiscAskResume(const CStdString& path) +bool CAutorun::PlayDiscAskResume(const std::string& path) { return PlayDisc(path, true, !CanResumePlayDVD(path) || CGUIDialogYesNo::ShowAndGetInput(341, -1, -1, -1, 13404, 12021)); } -bool CAutorun::CanResumePlayDVD(const CStdString& path) +bool CAutorun::CanResumePlayDVD(const std::string& path) { - CStdString strUniqueId = g_mediaManager.GetDiskUniqueId(path); + std::string strUniqueId = g_mediaManager.GetDiskUniqueId(path); if (!strUniqueId.empty()) { CVideoDatabase dbs; diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h index 04b1787a07586..37f8e6b752262 100644 --- a/xbmc/Autorun.h +++ b/xbmc/Autorun.h @@ -32,7 +32,8 @@ #ifdef HAS_DVD_DRIVE -#include "utils/StdString.h" +#include +#include namespace XFILE { @@ -55,19 +56,19 @@ class CAutorun public: CAutorun(); virtual ~CAutorun(); - static bool CanResumePlayDVD(const CStdString& path); - static bool PlayDisc(const CStdString& path="", bool bypassSettings = false, bool startFromBeginning = false); - static bool PlayDiscAskResume(const CStdString& path=""); + static bool CanResumePlayDVD(const std::string& path); + static bool PlayDisc(const std::string& path="", bool bypassSettings = false, bool startFromBeginning = false); + static bool PlayDiscAskResume(const std::string& path=""); bool IsEnabled() const; void Enable(); void Disable(); void HandleAutorun(); - static void ExecuteAutorun(const CStdString& path = "", bool bypassSettings = false, bool ignoreplaying = false, bool startFromBeginning = false); + static void ExecuteAutorun(const std::string& path = "", bool bypassSettings = false, bool ignoreplaying = false, bool startFromBeginning = false); static void SettingOptionAudioCdActionsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t, void *data); protected: - static bool RunDisc(XFILE::IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning); + static bool RunDisc(XFILE::IDirectory* pDir, const std::string& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning); bool m_bEnable; }; } diff --git a/xbmc/DynamicDll.cpp b/xbmc/DynamicDll.cpp index 764689b8ac118..96796eb474711 100644 --- a/xbmc/DynamicDll.cpp +++ b/xbmc/DynamicDll.cpp @@ -31,7 +31,7 @@ DllDynamic::DllDynamic() m_DelayUnload=true; } -DllDynamic::DllDynamic(const CStdString& strDllName) +DllDynamic::DllDynamic(const std::string& strDllName) { m_strDllName=strDllName; m_dll=NULL; @@ -83,7 +83,7 @@ bool DllDynamic::EnableDelayedUnload(bool bOnOff) return true; } -bool DllDynamic::SetFile(const CStdString& strDllName) +bool DllDynamic::SetFile(const std::string& strDllName) { if (m_dll) return false; diff --git a/xbmc/DynamicDll.h b/xbmc/DynamicDll.h index 3cf4e9bb7b12c..a0b817f1d41f3 100644 --- a/xbmc/DynamicDll.h +++ b/xbmc/DynamicDll.h @@ -20,7 +20,7 @@ */ #include "cores/DllLoader/LibraryLoader.h" -#include "utils/StdString.h" +#include #include "DllPaths.h" /////////////////////////////////////////////////////////// @@ -520,20 +520,20 @@ class DllDynamic { public: DllDynamic(); - DllDynamic(const CStdString& strDllName); + DllDynamic(const std::string& strDllName); virtual ~DllDynamic(); virtual bool Load(); virtual void Unload(); virtual bool IsLoaded() const { return m_dll!=NULL; } bool CanLoad(); bool EnableDelayedUnload(bool bOnOff); - bool SetFile(const CStdString& strDllName); - const CStdString &GetFile() const { return m_strDllName; } + bool SetFile(const std::string& strDllName); + const std::string &GetFile() const { return m_strDllName; } protected: virtual bool ResolveExports()=0; virtual bool LoadSymbols() { return false; } bool m_DelayUnload; LibraryLoader* m_dll; - CStdString m_strDllName; + std::string m_strDllName; }; diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index a9c13ccfd457f..2b7e0b8012a38 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -155,10 +155,10 @@ bool CGUIInfoManager::OnMessage(CGUIMessage &message) /// efficient retrieval of data. Can handle combined strings on the form /// Player.Caching + VideoPlayer.IsFullscreen (Logical and) /// Player.HasVideo | Player.HasAudio (Logical or) -int CGUIInfoManager::TranslateString(const CStdString &condition) +int CGUIInfoManager::TranslateString(const std::string &condition) { // translate $LOCALIZE as required - CStdString strCondition(CGUIInfoLabel::ReplaceLocalize(condition)); + std::string strCondition(CGUIInfoLabel::ReplaceLocalize(condition)); return TranslateSingleString(strCondition); } @@ -744,7 +744,7 @@ const int picture_slide_map[] = {/* LISTITEM_PICTURE_RESOLUTION => */ SLIDE_RES /* LISTITEM_PICTURE_GPS_LON => */ SLIDE_EXIF_GPS_LONGITUDE, /* LISTITEM_PICTURE_GPS_ALT => */ SLIDE_EXIF_GPS_ALTITUDE }; -CGUIInfoManager::Property::Property(const CStdString &property, const CStdString ¶meters) +CGUIInfoManager::Property::Property(const std::string &property, const std::string ¶meters) : name(property) { CUtil::SplitParams(parameters, params); @@ -762,14 +762,14 @@ unsigned int CGUIInfoManager::Property::num_params() const return params.size(); } -void CGUIInfoManager::SplitInfoString(const CStdString &infoString, vector &info) +void CGUIInfoManager::SplitInfoString(const std::string &infoString, vector &info) { // our string is of the form: // category[(params)][.info(params).info2(params)] ... // so we need to split on . while taking into account of () pairs unsigned int parentheses = 0; - CStdString property; - CStdString param; + std::string property; + std::string param; for (size_t i = 0; i < infoString.size(); ++i) { if (infoString[i] == '(') @@ -811,13 +811,13 @@ void CGUIInfoManager::SplitInfoString(const CStdString &infoString, vector info; @@ -851,7 +851,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool if (info2 > 0) return AddMultiInfo(GUIInfo(STRING_COMPARE, info, -info2)); // pipe our original string through the localize parsing then make it lowercase (picks up $LBRACKET etc.) - CStdString label = CGUIInfoLabel::GetLabel(cat.param(1)); + std::string label = CGUIInfoLabel::GetLabel(cat.param(1)); StringUtils::ToLower(label); int compareString = ConditionalStringParameter(label); return AddMultiInfo(GUIInfo(STRING_COMPARE, info, compareString)); @@ -865,7 +865,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool else if (cat.name == "substring" && cat.num_params() >= 2) { int info = TranslateSingleString(cat.param(0), listItemDependent); - CStdString label = CGUIInfoLabel::GetLabel(cat.param(1)); + std::string label = CGUIInfoLabel::GetLabel(cat.param(1)); StringUtils::ToLower(label); int compareString = ConditionalStringParameter(label); if (cat.num_params() > 2) @@ -935,7 +935,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool } if (prop.num_params() == 1) { - const CStdString ¶m = prop.param(); + const std::string ¶m = prop.param(); if (prop.name == "getbool") { std::string paramCopy = param; @@ -960,7 +960,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool int infoLabel = TranslateSingleString(param, listItemDependent); if (infoLabel > 0) return AddMultiInfo(GUIInfo(SYSTEM_ADDON_TITLE, infoLabel, 0)); - CStdString label = CGUIInfoLabel::GetLabel(param); + std::string label = CGUIInfoLabel::GetLabel(param); StringUtils::ToLower(label); return AddMultiInfo(GUIInfo(SYSTEM_ADDON_TITLE, ConditionalStringParameter(label), 1)); } @@ -969,7 +969,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool int infoLabel = TranslateSingleString(param, listItemDependent); if (infoLabel > 0) return AddMultiInfo(GUIInfo(SYSTEM_ADDON_ICON, infoLabel, 0)); - CStdString label = CGUIInfoLabel::GetLabel(param); + std::string label = CGUIInfoLabel::GetLabel(param); StringUtils::ToLower(label); return AddMultiInfo(GUIInfo(SYSTEM_ADDON_ICON, ConditionalStringParameter(label), 1)); } @@ -978,7 +978,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool int infoLabel = TranslateSingleString(param, listItemDependent); if (infoLabel > 0) return AddMultiInfo(GUIInfo(SYSTEM_ADDON_VERSION, infoLabel, 0)); - CStdString label = CGUIInfoLabel::GetLabel(param); + std::string label = CGUIInfoLabel::GetLabel(param); StringUtils::ToLower(label); return AddMultiInfo(GUIInfo(SYSTEM_ADDON_VERSION, ConditionalStringParameter(label), 1)); } @@ -1023,7 +1023,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool else if (prop.name == "isscanningmusic") return LIBRARY_IS_SCANNING_MUSIC; else if (prop.name == "hascontent" && prop.num_params()) { - CStdString cat = prop.param(0); + std::string cat = prop.param(0); StringUtils::ToLower(cat); if (cat == "music") return LIBRARY_HAS_MUSIC; else if (cat == "video") return LIBRARY_HAS_VIDEO; @@ -1260,12 +1260,12 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition, bool { if (info[0].name == "system" && info[1].name == "platform") { // TODO: replace with a single system.platform - CStdString platform = info[2].name; + std::string platform = info[2].name; if (platform == "linux") { if (info.size() == 4) { - CStdString device = info[3].name; + std::string device = info[3].name; if (device == "raspberrypi") return SYSTEM_PLATFORM_LINUX_RASPBERRY_PI; } else return SYSTEM_PLATFORM_LINUX; @@ -1336,7 +1336,7 @@ int CGUIInfoManager::TranslateListItem(const Property &info) return 0; } -int CGUIInfoManager::TranslateMusicPlayerString(const CStdString &info) const +int CGUIInfoManager::TranslateMusicPlayerString(const std::string &info) const { for (size_t i = 0; i < sizeof(musicplayer) / sizeof(infomap); i++) { @@ -1346,29 +1346,29 @@ int CGUIInfoManager::TranslateMusicPlayerString(const CStdString &info) const return 0; } -TIME_FORMAT CGUIInfoManager::TranslateTimeFormat(const CStdString &format) +TIME_FORMAT CGUIInfoManager::TranslateTimeFormat(const std::string &format) { if (format.empty()) return TIME_FORMAT_GUESS; - else if (format.Equals("hh")) return TIME_FORMAT_HH; - else if (format.Equals("mm")) return TIME_FORMAT_MM; - else if (format.Equals("ss")) return TIME_FORMAT_SS; - else if (format.Equals("hh:mm")) return TIME_FORMAT_HH_MM; - else if (format.Equals("mm:ss")) return TIME_FORMAT_MM_SS; - else if (format.Equals("hh:mm:ss")) return TIME_FORMAT_HH_MM_SS; - else if (format.Equals("hh:mm:ss xx")) return TIME_FORMAT_HH_MM_SS_XX; - else if (format.Equals("h")) return TIME_FORMAT_H; - else if (format.Equals("h:mm:ss")) return TIME_FORMAT_H_MM_SS; - else if (format.Equals("h:mm:ss xx")) return TIME_FORMAT_H_MM_SS_XX; - else if (format.Equals("xx")) return TIME_FORMAT_XX; + else if (StringUtils::EqualsNoCase(format, "hh")) return TIME_FORMAT_HH; + else if (StringUtils::EqualsNoCase(format, "mm")) return TIME_FORMAT_MM; + else if (StringUtils::EqualsNoCase(format, "ss")) return TIME_FORMAT_SS; + else if (StringUtils::EqualsNoCase(format, "hh:mm")) return TIME_FORMAT_HH_MM; + else if (StringUtils::EqualsNoCase(format, "mm:ss")) return TIME_FORMAT_MM_SS; + else if (StringUtils::EqualsNoCase(format, "hh:mm:ss")) return TIME_FORMAT_HH_MM_SS; + else if (StringUtils::EqualsNoCase(format, "hh:mm:ss xx")) return TIME_FORMAT_HH_MM_SS_XX; + else if (StringUtils::EqualsNoCase(format, "h")) return TIME_FORMAT_H; + else if (StringUtils::EqualsNoCase(format, "h:mm:ss")) return TIME_FORMAT_H_MM_SS; + else if (StringUtils::EqualsNoCase(format, "h:mm:ss xx")) return TIME_FORMAT_H_MM_SS_XX; + else if (StringUtils::EqualsNoCase(format, "xx")) return TIME_FORMAT_XX; return TIME_FORMAT_GUESS; } -CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *fallback) +std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *fallback) { if (info >= CONDITIONAL_LABEL_START && info <= CONDITIONAL_LABEL_END) return GetSkinVariableString(info, false); - CStdString strLabel; + std::string strLabel; if (info >= MULTI_INFO_START && info <= MULTI_INFO_END) return GetMultiInfoLabel(m_multiInfo[info - MULTI_INFO_START], contextWindow); @@ -1381,7 +1381,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *f if (!m_currentFile) return ""; - CStdString property = m_listitemProperties[info - LISTITEM_PROPERTY_START-MUSICPLAYER_PROPERTY_OFFSET]; + std::string property = m_listitemProperties[info - LISTITEM_PROPERTY_START-MUSICPLAYER_PROPERTY_OFFSET]; return m_currentFile->GetProperty(property).asString(); } @@ -1532,8 +1532,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *f return m_currentFile->GetPVRChannelInfoTag()->GetEPGNow(tag) ? tag.Title() : CSettings::Get().GetBool("epg.hidenoinfoavailable") ? - StringUtils::EmptyString : - g_localizeStrings.Get(19055); // no information available + "" : g_localizeStrings.Get(19055); // no information available } if (m_currentFile->HasPVRRecordingInfoTag() && !m_currentFile->GetPVRRecordingInfoTag()->m_strTitle.empty()) return m_currentFile->GetPVRRecordingInfoTag()->m_strTitle; @@ -1920,8 +1919,8 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *f break; case SYSTEM_FRIENDLY_NAME: { - CStdString friendlyName = CSettings::Get().GetString("services.devicename"); - if (friendlyName.Equals(CCompileInfo::GetAppName())) + std::string friendlyName = CSettings::Get().GetString("services.devicename"); + if (StringUtils::EqualsNoCase(friendlyName, CCompileInfo::GetAppName())) strLabel = StringUtils::Format("%s (%s)", friendlyName.c_str(), g_application.getNetwork().GetHostName().c_str()); else strLabel = friendlyName; @@ -1981,13 +1980,13 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *f break; case NETWORK_DHCP_ADDRESS: { - CStdString dhcpserver; + std::string dhcpserver; return dhcpserver; } break; case NETWORK_LINK_STATE: { - CStdString linkStatus = g_localizeStrings.Get(151); + std::string linkStatus = g_localizeStrings.Get(151); linkStatus += " "; CNetworkInterface* iface = g_application.getNetwork().GetFirstConnectedInterface(); if (iface && iface->IsConnected()) @@ -2177,9 +2176,9 @@ struct InfoBoolFinder InfoBool m_bool; }; -INFO::InfoPtr CGUIInfoManager::Register(const CStdString &expression, int context) +INFO::InfoPtr CGUIInfoManager::Register(const std::string &expression, int context) { - CStdString condition(CGUIInfoLabel::ReplaceLocalize(expression)); + std::string condition(CGUIInfoLabel::ReplaceLocalize(expression)); StringUtils::Trim(condition); if (condition.empty()) @@ -2199,7 +2198,7 @@ INFO::InfoPtr CGUIInfoManager::Register(const CStdString &expression, int contex return m_bools.back(); } -bool CGUIInfoManager::EvaluateBool(const CStdString &expression, int contextWindow) +bool CGUIInfoManager::EvaluateBool(const std::string &expression, int contextWindow) { bool result = false; INFO::InfoPtr info = Register(expression, contextWindow); @@ -2718,7 +2717,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c break; case SKIN_HAS_THEME: { - CStdString theme = CSettings::Get().GetString("lookandfeel.skintheme"); + std::string theme = CSettings::Get().GetString("lookandfeel.skintheme"); URIUtils::RemoveExtension(theme); bReturn = StringUtils::EqualsNoCase(theme, m_stringParameters[info.GetData1()]); } @@ -2732,7 +2731,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c break; case STRING_COMPARE: { - CStdString compare; + std::string compare; if (info.GetData2() < 0) // info labels are stored with negative numbers { int info2 = -info.GetData2(); @@ -2746,9 +2745,9 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c compare = m_stringParameters[info.GetData2()]; } if (item && item->IsFileItem() && info.GetData1() >= LISTITEM_START && info.GetData1() < LISTITEM_END) - bReturn = GetItemImage((const CFileItem *)item, info.GetData1()).Equals(compare); + bReturn = StringUtils::EqualsNoCase(GetItemImage((const CFileItem *)item, info.GetData1()), compare); else - bReturn = GetImage(info.GetData1(), contextWindow).Equals(compare); + bReturn = StringUtils::EqualsNoCase(GetImage(info.GetData1(), contextWindow), compare); } break; case INTEGER_GREATER_THAN: @@ -2758,7 +2757,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c bReturn = integer > info.GetData2(); else { - CStdString value; + std::string value; if (item && item->IsFileItem() && info.GetData1() >= LISTITEM_START && info.GetData1() < LISTITEM_END) value = GetItemImage((const CFileItem *)item, info.GetData1()); @@ -2778,10 +2777,10 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c case STRING_STR_LEFT: case STRING_STR_RIGHT: { - CStdString compare = m_stringParameters[info.GetData2()]; + std::string compare = m_stringParameters[info.GetData2()]; // our compare string is already in lowercase, so lower case our label as well - // as CStdString::Find() is case sensitive - CStdString label; + // as std::string::Find() is case sensitive + std::string label; if (item && item->IsFileItem() && info.GetData1() >= LISTITEM_START && info.GetData1() < LISTITEM_END) { label = GetItemImage((const CFileItem *)item, info.GetData1()); @@ -2931,7 +2930,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c break; case CONTAINER_CONTENT: { - CStdString content; + std::string content; CGUIWindow *window = GetWindowWithCondition(contextWindow, 0); if (window) { @@ -2992,7 +2991,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c } case VIDEOPLAYER_CONTENT: { - CStdString strContent="files"; + std::string strContent="files"; if (m_currentFile->HasVideoInfoTag() && m_currentFile->GetVideoInfoTag()->m_type == MediaTypeMovie) strContent = "movies"; if (m_currentFile->HasVideoInfoTag() && m_currentFile->GetVideoInfoTag()->m_iSeason > -1) // episode @@ -3133,7 +3132,7 @@ bool CGUIInfoManager::GetMultiInfoInt(int &value, const GUIInfo &info, int conte } /// \brief Examines the multi information sent and returns the string as appropriate -CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWindow, std::string *fallback) +std::string CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWindow, std::string *fallback) { if (info.m_info == SKIN_STRING) { @@ -3207,7 +3206,7 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi } else if (info.m_info == PLAYER_TIME_SPEED) { - CStdString strTime; + std::string strTime; if (g_application.m_pPlayer->GetPlaySpeed() != 1) strTime = StringUtils::Format("%s (%ix)", GetCurrentPlayTime((TIME_FORMAT)info.GetData1()).c_str(), g_application.m_pPlayer->GetPlaySpeed()); else @@ -3224,7 +3223,7 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi } else if (info.m_info == PLAYER_SEEKOFFSET) { - CStdString seekOffset = StringUtils::SecondsToTimeString(abs(m_seekOffset / 1000), (TIME_FORMAT)info.GetData1()); + std::string seekOffset = StringUtils::SecondsToTimeString(abs(m_seekOffset / 1000), (TIME_FORMAT)info.GetData1()); if (m_seekOffset < 0) return "-" + seekOffset; if (m_seekOffset > 0) @@ -3270,7 +3269,7 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi } else if (info.m_info == SYSTEM_GET_CORE_USAGE) { - CStdString strCpu = StringUtils::Format("%4.2f", g_cpuInfo.GetCoreInfo(atoi(m_stringParameters[info.GetData1()].c_str())).m_fPct); + std::string strCpu = StringUtils::Format("%4.2f", g_cpuInfo.GetCoreInfo(atoi(m_stringParameters[info.GetData1()].c_str())).m_fPct); return strCpu; } else if (info.m_info >= MUSICPLAYER_TITLE && info.m_info <= MUSICPLAYER_ALBUM_ARTIST) @@ -3350,11 +3349,11 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi return GetPlaylistLabel(info.m_info, playlistid); } - return StringUtils::EmptyString; + return ""; } /// \brief Obtains the filename of the image to show from whichever subsystem is needed -CStdString CGUIInfoManager::GetImage(int info, int contextWindow, std::string *fallback) +std::string CGUIInfoManager::GetImage(int info, int contextWindow, std::string *fallback) { if (info >= CONDITIONAL_LABEL_START && info <= CONDITIONAL_LABEL_END) return GetSkinVariableString(info, true); @@ -3367,7 +3366,7 @@ CStdString CGUIInfoManager::GetImage(int info, int contextWindow, std::string *f return g_weatherManager.GetInfo(WEATHER_IMAGE_CURRENT_ICON); else if (info == SYSTEM_PROFILETHUMB) { - CStdString thumb = CProfilesManager::Get().GetCurrentProfile().getThumb(); + std::string thumb = CProfilesManager::Get().GetCurrentProfile().getThumb(); if (thumb.empty()) thumb = "unknown-user.png"; return thumb; @@ -3412,21 +3411,21 @@ CStdString CGUIInfoManager::GetImage(int info, int contextWindow, std::string *f return GetLabel(info, contextWindow, fallback); } -CStdString CGUIInfoManager::GetDate(bool bNumbersOnly) +std::string CGUIInfoManager::GetDate(bool bNumbersOnly) { CDateTime time=CDateTime::GetCurrentDateTime(); return time.GetAsLocalizedDate(!bNumbersOnly); } -CStdString CGUIInfoManager::GetTime(TIME_FORMAT format) const +std::string CGUIInfoManager::GetTime(TIME_FORMAT format) const { CDateTime time=CDateTime::GetCurrentDateTime(); return LocalizeTime(time, format); } -CStdString CGUIInfoManager::LocalizeTime(const CDateTime &time, TIME_FORMAT format) const +std::string CGUIInfoManager::LocalizeTime(const CDateTime &time, TIME_FORMAT format) const { - const CStdString timeFormat = g_langInfo.GetTimeFormat(); + const std::string timeFormat = g_langInfo.GetTimeFormat(); bool use12hourclock = timeFormat.find('h') != std::string::npos; switch (format) { @@ -3462,7 +3461,7 @@ CStdString CGUIInfoManager::LocalizeTime(const CDateTime &time, TIME_FORMAT form return time.GetAsLocalizedTime("", false); } -CStdString CGUIInfoManager::GetDuration(TIME_FORMAT format) const +std::string CGUIInfoManager::GetDuration(TIME_FORMAT format) const { if (g_application.m_pPlayer->IsPlayingAudio() && m_currentFile->HasMusicInfoTag()) { @@ -3478,7 +3477,7 @@ CStdString CGUIInfoManager::GetDuration(TIME_FORMAT format) const return ""; } -CStdString CGUIInfoManager::GetMusicPartyModeLabel(int item) +std::string CGUIInfoManager::GetMusicPartyModeLabel(int item) { // get song counts if (item >= MUSICPM_SONGSPLAYED && item <= MUSICPM_RANDOMSONGSPICKED) @@ -3519,13 +3518,13 @@ CStdString CGUIInfoManager::GetMusicPartyModeLabel(int item) } if (iSongs < 0) return ""; - CStdString strLabel = StringUtils::Format("%i", iSongs); + std::string strLabel = StringUtils::Format("%i", iSongs); return strLabel; } return ""; } -const CStdString CGUIInfoManager::GetMusicPlaylistInfo(const GUIInfo& info) +const std::string CGUIInfoManager::GetMusicPlaylistInfo(const GUIInfo& info) { PLAYLIST::CPlayList& playlist = g_playlistPlayer.GetPlaylist(PLAYLIST_MUSIC); if (playlist.size() < 1) @@ -3556,7 +3555,7 @@ const CStdString CGUIInfoManager::GetMusicPlaylistInfo(const GUIInfo& info) } if (info.m_info == MUSICPLAYER_PLAYLISTPOS) { - CStdString strPosition = StringUtils::Format("%i", index + 1); + std::string strPosition = StringUtils::Format("%i", index + 1); return strPosition; } else if (info.m_info == MUSICPLAYER_COVER) @@ -3564,7 +3563,7 @@ const CStdString CGUIInfoManager::GetMusicPlaylistInfo(const GUIInfo& info) return GetMusicTagLabel(info.m_info, playlistItem.get()); } -CStdString CGUIInfoManager::GetPlaylistLabel(int item, int playlistid /* = PLAYLIST_NONE */) const +std::string CGUIInfoManager::GetPlaylistLabel(int item, int playlistid /* = PLAYLIST_NONE */) const { if (playlistid <= PLAYLIST_NONE && !g_application.m_pPlayer->IsPlaying()) return ""; @@ -3601,7 +3600,7 @@ CStdString CGUIInfoManager::GetPlaylistLabel(int item, int playlistid /* = PLAYL return ""; } -CStdString CGUIInfoManager::GetMusicLabel(int item) +std::string CGUIInfoManager::GetMusicLabel(int item) { if (!g_application.m_pPlayer->IsPlaying() || !m_currentFile->HasMusicInfoTag()) return ""; @@ -3621,7 +3620,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item) break; case MUSICPLAYER_BITRATE: { - CStdString strBitrate = ""; + std::string strBitrate = ""; if (m_audioInfo.bitrate > 0) strBitrate = StringUtils::Format("%i", MathUtils::round_int((double)m_audioInfo.bitrate / 1000.0)); return strBitrate; @@ -3629,7 +3628,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item) break; case MUSICPLAYER_CHANNELS: { - CStdString strChannels = ""; + std::string strChannels = ""; if (m_audioInfo.channels > 0) { strChannels = StringUtils::Format("%i", m_audioInfo.channels); @@ -3639,7 +3638,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item) break; case MUSICPLAYER_BITSPERSAMPLE: { - CStdString strBitsPerSample = ""; + std::string strBitsPerSample = ""; if (m_audioInfo.bitspersample > 0) strBitsPerSample = StringUtils::Format("%i", m_audioInfo.bitspersample); return strBitsPerSample; @@ -3647,7 +3646,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item) break; case MUSICPLAYER_SAMPLERATE: { - CStdString strSampleRate = ""; + std::string strSampleRate = ""; if (m_audioInfo.samplerate > 0) strSampleRate = StringUtils::Format("%.5g", ((double)m_audioInfo.samplerate / 1000.0)); return strSampleRate; @@ -3664,7 +3663,7 @@ CStdString CGUIInfoManager::GetMusicLabel(int item) return GetMusicTagLabel(item, m_currentFile); } -CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) +std::string CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) { if (!item->HasMusicInfoTag()) return ""; const CMusicInfoTag &tag = *item->GetMusicInfoTag(); @@ -3693,7 +3692,7 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) break; case MUSICPLAYER_TRACK_NUMBER: { - CStdString strTrack; + std::string strTrack; if (tag.Loaded() && tag.GetTrackNumber() > 0) { return StringUtils::Format("%02i", tag.GetTrackNumber()); @@ -3746,7 +3745,7 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) return ""; } -CStdString CGUIInfoManager::GetVideoLabel(int item) +std::string CGUIInfoManager::GetVideoLabel(int item) { if (!g_application.m_pPlayer->IsPlaying()) return ""; @@ -3778,8 +3777,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) return tag->GetEPGNow(epgTag) ? epgTag.Title() : CSettings::Get().GetBool("epg.hidenoinfoavailable") ? - StringUtils::EmptyString : - g_localizeStrings.Get(19055); // no information available + "" : g_localizeStrings.Get(19055); // no information available case VIDEOPLAYER_GENRE: return tag->GetEPGNow(epgTag) ? StringUtils::Join(epgTag.Genre(), g_advancedSettings.m_videoItemSeparator) : ""; case VIDEOPLAYER_PLOT: @@ -3796,8 +3794,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) return tag->GetEPGNext(epgTag) ? epgTag.Title() : CSettings::Get().GetBool("epg.hidenoinfoavailable") ? - StringUtils::EmptyString : - g_localizeStrings.Get(19055); // no information available + "" : g_localizeStrings.Get(19055); // no information available case VIDEOPLAYER_NEXT_GENRE: return tag->GetEPGNext(epgTag) ? StringUtils::Join(epgTag.Genre(), g_advancedSettings.m_videoItemSeparator) : ""; case VIDEOPLAYER_NEXT_PLOT: @@ -3810,7 +3807,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) return tag->GetEPGNext(epgTag) ? epgTag.EndAsLocalTime().GetAsLocalizedTime("", false) : CDateTime::GetCurrentDateTime().GetAsLocalizedTime("", false); case VIDEOPLAYER_NEXT_DURATION: { - CStdString duration; + std::string duration; if (tag->GetEPGNext(epgTag) && epgTag.GetDuration() > 0) duration = StringUtils::SecondsToTimeString(epgTag.GetDuration()); return duration; @@ -3818,7 +3815,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) case VIDEOPLAYER_PARENTAL_RATING: { - CStdString rating; + std::string rating; if (tag->GetEPGNow(epgTag) && epgTag.ParentalRating() > 0) rating = StringUtils::Format("%i", epgTag.ParentalRating()); return rating; @@ -3860,7 +3857,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) break; case VIDEOPLAYER_RATING: { - CStdString strRating; + std::string strRating; if (m_currentFile->GetVideoInfoTag()->m_fRating > 0.f) strRating = StringUtils::Format("%.1f", m_currentFile->GetVideoInfoTag()->m_fRating); return strRating; @@ -3868,7 +3865,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) break; case VIDEOPLAYER_RATING_AND_VOTES: { - CStdString strRatingAndVotes; + std::string strRatingAndVotes; if (m_currentFile->GetVideoInfoTag()->m_fRating > 0.f) { if (m_currentFile->GetVideoInfoTag()->m_strVotes.empty()) @@ -3887,7 +3884,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) return m_currentFile->GetVideoInfoTag()->m_strVotes; case VIDEOPLAYER_YEAR: { - CStdString strYear; + std::string strYear; if (m_currentFile->GetVideoInfoTag()->m_iYear > 0) strYear = StringUtils::Format("%i", m_currentFile->GetVideoInfoTag()->m_iYear); return strYear; @@ -3915,7 +3912,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) case VIDEOPLAYER_EPISODE: if (m_currentFile->GetVideoInfoTag()->m_iEpisode > 0) { - CStdString strEpisode; + std::string strEpisode; if (m_currentFile->GetVideoInfoTag()->m_iSeason == 0) // prefix episode with 'S' strEpisode = StringUtils::Format("S%i", m_currentFile->GetVideoInfoTag()->m_iEpisode); else @@ -3940,7 +3937,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) return m_currentFile->GetVideoInfoTag()->m_strMPAARating; case VIDEOPLAYER_TOP250: { - CStdString strTop250; + std::string strTop250; if (m_currentFile->GetVideoInfoTag()->m_iTop250 > 0) strTop250 = StringUtils::Format("%i", m_currentFile->GetVideoInfoTag()->m_iTop250); return strTop250; @@ -3966,7 +3963,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item) } case VIDEOPLAYER_PLAYCOUNT: { - CStdString strPlayCount; + std::string strPlayCount; if (m_currentFile->GetVideoInfoTag()->m_playCount > 0) strPlayCount = StringUtils::Format("%i", m_currentFile->GetVideoInfoTag()->m_playCount); return strPlayCount; @@ -3987,7 +3984,7 @@ int64_t CGUIInfoManager::GetPlayTime() const return 0; } -CStdString CGUIInfoManager::GetCurrentPlayTime(TIME_FORMAT format) const +std::string CGUIInfoManager::GetCurrentPlayTime(TIME_FORMAT format) const { if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600) format = TIME_FORMAT_HH_MM_SS; @@ -3996,7 +3993,7 @@ CStdString CGUIInfoManager::GetCurrentPlayTime(TIME_FORMAT format) const return ""; } -CStdString CGUIInfoManager::GetCurrentSeekTime(TIME_FORMAT format) const +std::string CGUIInfoManager::GetCurrentSeekTime(TIME_FORMAT format) const { if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600) format = TIME_FORMAT_HH_MM_SS; @@ -4016,7 +4013,7 @@ int CGUIInfoManager::GetPlayTimeRemaining() const return iReverse > 0 ? iReverse : 0; } -CStdString CGUIInfoManager::GetCurrentPlayTimeRemaining(TIME_FORMAT format) const +std::string CGUIInfoManager::GetCurrentPlayTimeRemaining(TIME_FORMAT format) const { if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600) format = TIME_FORMAT_HH_MM_SS; @@ -4055,7 +4052,7 @@ void CGUIInfoManager::SetCurrentItem(CFileItem &item) NotifyObservers(ObservableMessageCurrentItem); } -void CGUIInfoManager::SetCurrentAlbumThumb(const CStdString &thumbFileName) +void CGUIInfoManager::SetCurrentAlbumThumb(const std::string &thumbFileName) { if (CFile::Exists(thumbFileName)) m_currentFile->SetArt("thumb", thumbFileName); @@ -4114,8 +4111,8 @@ void CGUIInfoManager::SetCurrentMovie(CFileItem &item) CVideoDatabase dbs; if (dbs.Open()) { - CStdString path = item.GetPath(); - CStdString videoInfoTagPath(item.GetVideoInfoTag()->m_strFileNameAndPath); + std::string path = item.GetPath(); + std::string videoInfoTagPath(item.GetVideoInfoTag()->m_strFileNameAndPath); if (videoInfoTagPath.find("removable://") == 0) path = videoInfoTagPath; dbs.LoadVideoInfo(path, *m_currentFile->GetVideoInfoTag()); @@ -4167,7 +4164,7 @@ string CGUIInfoManager::GetSystemHeatInfo(int info) #endif } - CStdString text; + std::string text; switch(info) { case SYSTEM_CPU_TEMPERATURE: @@ -4201,7 +4198,7 @@ CTemperature CGUIInfoManager::GetGPUTemperature() value = SMCGetTemperature(SMC_KEY_GPU_TEMP); return CTemperature::CreateFromCelsius(value); #else - CStdString cmd = g_advancedSettings.m_gpuTempCmd; + std::string cmd = g_advancedSettings.m_gpuTempCmd; int ret = 0; FILE *p = NULL; @@ -4232,17 +4229,17 @@ std::string CGUIInfoManager::GetVersionShort(void) return StringUtils::Format("%d.%d-%s", CCompileInfo::GetMajor(), CCompileInfo::GetMinor(), CCompileInfo::GetSuffix()); } -CStdString CGUIInfoManager::GetVersion() +std::string CGUIInfoManager::GetVersion() { return GetVersionShort() + " Git:" + CCompileInfo::GetSCMID(); } -CStdString CGUIInfoManager::GetBuild() +std::string CGUIInfoManager::GetBuild() { return StringUtils::Format("%s", __DATE__); } -CStdString CGUIInfoManager::GetAppName() +std::string CGUIInfoManager::GetAppName() { return CCompileInfo::GetAppName(); } @@ -4322,7 +4319,7 @@ void CGUIInfoManager::UpdateAVInfo() } } -int CGUIInfoManager::AddListItemProp(const CStdString &str, int offset) +int CGUIInfoManager::AddListItemProp(const std::string &str, int offset) { for (int i=0; i < (int)m_listitemProperties.size(); i++) if (m_listitemProperties[i] == str) @@ -4352,7 +4349,7 @@ int CGUIInfoManager::AddMultiInfo(const GUIInfo &info) return id; } -int CGUIInfoManager::ConditionalStringParameter(const CStdString ¶meter, bool caseSensitive /*= false*/) +int CGUIInfoManager::ConditionalStringParameter(const std::string ¶meter, bool caseSensitive /*= false*/) { // check to see if we have this parameter already if (caseSensitive) @@ -4383,9 +4380,9 @@ bool CGUIInfoManager::GetItemInt(int &value, const CGUIListItem *item, int info) if (info >= LISTITEM_PROPERTY_START && info - LISTITEM_PROPERTY_START < (int)m_listitemProperties.size()) { // grab the property - CStdString property = m_listitemProperties[info - LISTITEM_PROPERTY_START]; - CStdString val = item->GetProperty(property).asString(); - value = atoi(val); + std::string property = m_listitemProperties[info - LISTITEM_PROPERTY_START]; + std::string val = item->GetProperty(property).asString(); + value = atoi(val.c_str()); return true; } @@ -4426,7 +4423,7 @@ bool CGUIInfoManager::GetItemInt(int &value, const CGUIListItem *item, int info) return false; } -CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::string *fallback) +std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::string *fallback) { if (!item) return ""; @@ -4441,7 +4438,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (info >= LISTITEM_PROPERTY_START && info - LISTITEM_PROPERTY_START < (int)m_listitemProperties.size()) { // grab the property - CStdString property = m_listitemProperties[info - LISTITEM_PROPERTY_START]; + std::string property = m_listitemProperties[info - LISTITEM_PROPERTY_START]; return item->GetProperty(property).asString(); } @@ -4461,8 +4458,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s return item->GetPVRChannelInfoTag()->GetEPGNow(epgTag) ? epgTag.Title() : CSettings::Get().GetBool("epg.hidenoinfoavailable") ? - StringUtils::EmptyString : - g_localizeStrings.Get(19055); // no information available + "" : g_localizeStrings.Get(19055); // no information available } if (item->HasPVRRecordingInfoTag()) return item->GetPVRRecordingInfoTag()->m_strTitle; @@ -4481,7 +4477,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s break; case LISTITEM_PLAYCOUNT: { - CStdString strPlayCount; + std::string strPlayCount; if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount > 0) strPlayCount = StringUtils::Format("%i", item->GetVideoInfoTag()->m_playCount); if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetPlayCount() > 0) @@ -4502,7 +4498,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s } case LISTITEM_TRACKNUMBER: { - CStdString track; + std::string track; if (item->HasMusicInfoTag()) track = StringUtils::Format("%i", item->GetMusicInfoTag()->GetTrackNumber()); if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_iTrack > -1 ) @@ -4511,7 +4507,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s } case LISTITEM_DISC_NUMBER: { - CStdString disc; + std::string disc; if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetDiscNumber() > 0) disc = StringUtils::Format("%i", item->GetMusicInfoTag()->GetDiscNumber()); return disc; @@ -4539,7 +4535,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_YEAR: if (item->HasVideoInfoTag()) { - CStdString strResult; + std::string strResult; if (item->GetVideoInfoTag()->m_iYear > 0) strResult = StringUtils::Format("%i",item->GetVideoInfoTag()->m_iYear); return strResult; @@ -4579,7 +4575,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_FILENAME: case LISTITEM_FILE_EXTENSION: { - CStdString strFile; + std::string strFile; if (item->IsMusicDb() && item->HasMusicInfoTag()) strFile = URIUtils::GetFileName(item->GetMusicInfoTag()->GetURL()); else if (item->IsVideoDb() && item->HasVideoInfoTag()) @@ -4589,7 +4585,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (info==LISTITEM_FILE_EXTENSION) { - CStdString strExtension = URIUtils::GetExtension(strFile); + std::string strExtension = URIUtils::GetExtension(strFile); return StringUtils::TrimLeft(strExtension, "."); } return strFile; @@ -4616,7 +4612,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s break; case LISTITEM_RATING: { - CStdString rating; + std::string rating; if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_fRating > 0.f) // movie rating rating = StringUtils::Format("%.1f", item->GetVideoInfoTag()->m_fRating); else if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetRating() > '0') @@ -4629,7 +4625,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s { if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_fRating > 0.f) // movie rating { - CStdString strRatingAndVotes; + std::string strRatingAndVotes; if (item->GetVideoInfoTag()->m_strVotes.empty()) strRatingAndVotes = StringUtils::Format("%.1f", item->GetVideoInfoTag()->m_fRating); @@ -4652,14 +4648,14 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s } case LISTITEM_DURATION: { - CStdString duration; + std::string duration; if (item->HasPVRChannelInfoTag()) { const CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL; CEpgInfoTag tag; if (channel && channel->GetEPGNow(tag)) return StringUtils::SecondsToTimeString(tag.GetDuration()); - return StringUtils::EmptyString; + return ""; } else if (item->HasPVRRecordingInfoTag()) { @@ -4690,7 +4686,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s CEpgInfoTag tag; if (channel && channel->GetEPGNow(tag)) return tag.Plot(); - return StringUtils::EmptyString; + return ""; } if (item->HasEPGInfoTag()) return item->GetEPGInfoTag()->Plot(); @@ -4712,7 +4708,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s CEpgInfoTag tag; if (channel && channel->GetEPGNow(tag)) return tag.PlotOutline(); - return StringUtils::EmptyString; + return ""; } if (item->HasEPGInfoTag()) return item->GetEPGInfoTag()->PlotOutline(); @@ -4724,7 +4720,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_EPISODE: if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_iEpisode > 0) { - CStdString strResult; + std::string strResult; if (item->GetVideoInfoTag()->m_iSeason == 0) // prefix episode with 'S' strResult = StringUtils::Format("S%d",item->GetVideoInfoTag()->m_iEpisode); else @@ -4752,7 +4748,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s return item->GetIconImage(); case LISTITEM_ICON: { - CStdString strThumb = item->GetArt("thumb"); + std::string strThumb = item->GetArt("thumb"); if (strThumb.empty()) strThumb = item->GetIconImage(); if (fallback) @@ -4768,7 +4764,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_FOLDERNAME: case LISTITEM_PATH: { - CStdString path; + std::string path; if (item->IsMusicDb() && item->HasMusicInfoTag()) path = URIUtils::GetDirectory(item->GetMusicInfoTag()->GetURL()); else if (item->IsVideoDb() && item->HasVideoInfoTag()) @@ -4790,7 +4786,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s } case LISTITEM_FILENAME_AND_PATH: { - CStdString path; + std::string path; if (item->IsMusicDb() && item->HasMusicInfoTag()) path = item->GetMusicInfoTag()->GetURL(); else if (item->IsVideoDb() && item->HasVideoInfoTag()) @@ -4839,7 +4835,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_TOP250: if (item->HasVideoInfoTag()) { - CStdString strResult; + std::string strResult; if (item->GetVideoInfoTag()->m_iTop250 > 0) strResult = StringUtils::Format("%i",item->GetVideoInfoTag()->m_iTop250); return strResult; @@ -4847,7 +4843,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s break; case LISTITEM_SORT_LETTER: { - CStdString letter; + std::string letter; std::wstring character(1, item->GetSortLabel()[0]); StringUtils::ToUpper(character); g_charsetConverter.wToUTF8(character, letter); @@ -4875,7 +4871,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s case LISTITEM_AUDIO_CHANNELS: if (item->HasVideoInfoTag()) { - CStdString strResult; + std::string strResult; int iChannels = item->GetVideoInfoTag()->m_streamDetails.GetAudioChannels(); if (iChannels > -1) strResult = StringUtils::Format("%i", iChannels); @@ -4956,7 +4952,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s break; case LISTITEM_CHANNEL_NUMBER: { - CStdString number; + std::string number; if (item->HasPVRChannelInfoTag()) number = StringUtils::Format("%i", item->GetPVRChannelInfoTag()->ChannelNumber()); if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->HasPVRChannel()) @@ -4969,7 +4965,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s break; case LISTITEM_SUB_CHANNEL_NUMBER: { - CStdString number; + std::string number; if (item->HasPVRChannelInfoTag()) number = StringUtils::Format("%i", item->GetPVRChannelInfoTag()->SubChannelNumber()); if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->HasPVRChannel()) @@ -5044,7 +5040,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (channel && channel->GetEPGNext(tag)) return tag.Plot(); } - return StringUtils::EmptyString; + return ""; case LISTITEM_NEXT_PLOT_OUTLINE: { const CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL; @@ -5052,7 +5048,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (channel && channel->GetEPGNext(tag)) return tag.PlotOutline(); } - return StringUtils::EmptyString; + return ""; case LISTITEM_NEXT_DURATION: { const CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL; @@ -5060,7 +5056,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (channel && channel->GetEPGNext(tag)) return StringUtils::SecondsToTimeString(tag.GetDuration()); } - return StringUtils::EmptyString; + return ""; case LISTITEM_NEXT_GENRE: { const CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL; @@ -5068,7 +5064,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (channel && channel->GetEPGNext(tag)) return StringUtils::Join(tag.Genre(), g_advancedSettings.m_videoItemSeparator); } - return StringUtils::EmptyString; + return ""; case LISTITEM_NEXT_TITLE: { const CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL; @@ -5076,10 +5072,10 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s if (channel && channel->GetEPGNext(tag)) return tag.Title(); } - return StringUtils::EmptyString; + return ""; case LISTITEM_PARENTALRATING: { - CStdString rating; + std::string rating; if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->ParentalRating() > 0) rating = StringUtils::Format("%i", item->GetEPGInfoTag()->ParentalRating()); return rating; @@ -5123,7 +5119,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std::s return ""; } -CStdString CGUIInfoManager::GetItemImage(const CFileItem *item, int info, std::string *fallback) +std::string CGUIInfoManager::GetItemImage(const CFileItem *item, int info, std::string *fallback) { if (info >= CONDITIONAL_LABEL_START && info <= CONDITIONAL_LABEL_END) return GetSkinVariableString(info, true, item); @@ -5140,7 +5136,7 @@ CStdString CGUIInfoManager::GetItemImage(const CFileItem *item, int info, std::s break; case LISTITEM_STAR_RATING: { - CStdString rating; + std::string rating; if (item->HasVideoInfoTag()) { // rating for videos is assumed 0..10, so convert to 0..5 rating = StringUtils::Format("rating%ld.png", (long)((item->GetVideoInfoTag()->m_fRating * 0.5f) + 0.5f)); @@ -5162,7 +5158,7 @@ bool CGUIInfoManager::GetItemBool(const CGUIListItem *item, int condition) const if (!item) return false; if (condition >= LISTITEM_PROPERTY_START && condition - LISTITEM_PROPERTY_START < (int)m_listitemProperties.size()) { // grab the property - CStdString property = m_listitemProperties[condition - LISTITEM_PROPERTY_START]; + std::string property = m_listitemProperties[condition - LISTITEM_PROPERTY_START]; return item->GetProperty(property).asBoolean(); } else if (condition == LISTITEM_ISPLAYING) @@ -5314,7 +5310,7 @@ void CGUIInfoManager::UpdateFromTuxBox() g_tuxbox.sCurSrvData.current_event_description != "-" && g_tuxbox.sCurSrvData.next_event_description != "-") { - CStdString genre = StringUtils::Format("%s %s - (%s: %s)", + std::string genre = StringUtils::Format("%s %s - (%s: %s)", g_localizeStrings.Get(143).c_str(), g_tuxbox.sCurSrvData.current_event_description.c_str(), g_localizeStrings.Get(209).c_str(), @@ -5330,13 +5326,13 @@ void CGUIInfoManager::UpdateFromTuxBox() } } -CStdString CGUIInfoManager::GetPictureLabel(int info) +std::string CGUIInfoManager::GetPictureLabel(int info) { if (info == SLIDE_FILE_NAME) return GetItemLabel(m_currentSlide, LISTITEM_FILENAME); else if (info == SLIDE_FILE_PATH) { - CStdString path = URIUtils::GetDirectory(m_currentSlide->GetPath()); + std::string path = URIUtils::GetDirectory(m_currentSlide->GetPath()); return CURL(path).GetWithoutUserDetails(); } else if (info == SLIDE_FILE_SIZE) @@ -5580,7 +5576,7 @@ int CGUIInfoManager::RegisterSkinVariableString(const CSkinVariableString* info) return CONDITIONAL_LABEL_START + m_skinVariableStrings.size() - 1; } -int CGUIInfoManager::TranslateSkinVariableString(const CStdString& name, int context) +int CGUIInfoManager::TranslateSkinVariableString(const std::string& name, int context) { for (vector::const_iterator it = m_skinVariableStrings.begin(); it != m_skinVariableStrings.end(); ++it) @@ -5591,7 +5587,7 @@ int CGUIInfoManager::TranslateSkinVariableString(const CStdString& name, int con return 0; } -CStdString CGUIInfoManager::GetSkinVariableString(int info, +std::string CGUIInfoManager::GetSkinVariableString(int info, bool preferImage /*= false*/, const CGUIListItem *item /*= NULL*/) { diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h index a6ab129a00744..7cefda1adcb47 100644 --- a/xbmc/GUIInfoManager.h +++ b/xbmc/GUIInfoManager.h @@ -730,7 +730,7 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable \param context the context window \return an identifier used to reference this expression */ - INFO::InfoPtr Register(const CStdString &expression, int context = 0); + INFO::InfoPtr Register(const std::string &expression, int context = 0); /*! \brief Evaluate a boolean expression \param expression the expression to evaluate @@ -738,9 +738,9 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable \return the value of the evaluated expression. \sa Register */ - bool EvaluateBool(const CStdString &expression, int context = 0); + bool EvaluateBool(const std::string &expression, int context = 0); - int TranslateString(const CStdString &strCondition); + int TranslateString(const std::string &strCondition); /*! \brief Get integer value of info. \param value int reference to pass value of given info @@ -751,20 +751,20 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable \sa GetItemInt, GetMultiInfoInt */ bool GetInt(int &value, int info, int contextWindow = 0, const CGUIListItem *item = NULL) const; - CStdString GetLabel(int info, int contextWindow = 0, std::string *fallback = NULL); + std::string GetLabel(int info, int contextWindow = 0, std::string *fallback = NULL); - CStdString GetImage(int info, int contextWindow, std::string *fallback = NULL); + std::string GetImage(int info, int contextWindow, std::string *fallback = NULL); - CStdString GetTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; - CStdString GetDate(bool bNumbersOnly = false); - CStdString GetDuration(TIME_FORMAT format = TIME_FORMAT_GUESS) const; + std::string GetTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; + std::string GetDate(bool bNumbersOnly = false); + std::string GetDuration(TIME_FORMAT format = TIME_FORMAT_GUESS) const; void SetCurrentItem(CFileItem &item); void ResetCurrentItem(); // Current song stuff /// \brief Retrieves tag info (if necessary) and fills in our current song path. void SetCurrentSong(CFileItem &item); - void SetCurrentAlbumThumb(const CStdString &thumbFileName); + void SetCurrentAlbumThumb(const std::string &thumbFileName); void SetCurrentMovie(CFileItem &item); void SetCurrentSlide(CFileItem &item); const CFileItem &GetCurrentSlide() const; @@ -775,24 +775,24 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable const MUSIC_INFO::CMusicInfoTag *GetCurrentSongTag() const; const CVideoInfoTag* GetCurrentMovieTag() const; - CStdString GetMusicLabel(int item); - CStdString GetMusicTagLabel(int info, const CFileItem *item); - CStdString GetVideoLabel(int item); - CStdString GetPlaylistLabel(int item, int playlistid = -1 /* PLAYLIST_NONE */) const; - CStdString GetMusicPartyModeLabel(int item); - const CStdString GetMusicPlaylistInfo(const GUIInfo& info); - CStdString GetPictureLabel(int item); + std::string GetMusicLabel(int item); + std::string GetMusicTagLabel(int info, const CFileItem *item); + std::string GetVideoLabel(int item); + std::string GetPlaylistLabel(int item, int playlistid = -1 /* PLAYLIST_NONE */) const; + std::string GetMusicPartyModeLabel(int item); + const std::string GetMusicPlaylistInfo(const GUIInfo& info); + std::string GetPictureLabel(int item); int64_t GetPlayTime() const; // in ms - CStdString GetCurrentPlayTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; - CStdString GetCurrentSeekTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; + std::string GetCurrentPlayTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; + std::string GetCurrentSeekTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const; int GetPlayTimeRemaining() const; int GetTotalPlayTime() const; - CStdString GetCurrentPlayTimeRemaining(TIME_FORMAT format) const; + std::string GetCurrentPlayTimeRemaining(TIME_FORMAT format) const; std::string GetVersionShort(void); - CStdString GetAppName(); - CStdString GetVersion(); - CStdString GetBuild(); + std::string GetAppName(); + std::string GetVersion(); + std::string GetBuild(); bool GetDisplayAfterSeek(); void SetDisplayAfterSeek(unsigned int timeOut = 2500, int seekOffset = 0); @@ -816,8 +816,8 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable void ResetCache(); bool GetItemInt(int &value, const CGUIListItem *item, int info) const; - CStdString GetItemLabel(const CFileItem *item, int info, std::string *fallback = NULL); - CStdString GetItemImage(const CFileItem *item, int info, std::string *fallback = NULL); + std::string GetItemLabel(const CFileItem *item, int info, std::string *fallback = NULL); + std::string GetItemImage(const CFileItem *item, int info, std::string *fallback = NULL); // Called from tuxbox service thread to update current status void UpdateFromTuxBox(); @@ -836,13 +836,13 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable void SetLibraryBool(int condition, bool value); bool GetLibraryBool(int condition); void ResetLibraryBools(); - CStdString LocalizeTime(const CDateTime &time, TIME_FORMAT format) const; + std::string LocalizeTime(const CDateTime &time, TIME_FORMAT format) const; - int TranslateSingleString(const CStdString &strCondition); + int TranslateSingleString(const std::string &strCondition); int RegisterSkinVariableString(const INFO::CSkinVariableString* info); - int TranslateSkinVariableString(const CStdString& name, int context); - CStdString GetSkinVariableString(int info, bool preferImage = false, const CGUIListItem *item=NULL); + int TranslateSkinVariableString(const std::string& name, int context); + std::string GetSkinVariableString(int info, bool preferImage = false, const CGUIListItem *item=NULL); /// \brief iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value. bool ConditionsChangedValues(const std::map& map); @@ -850,7 +850,7 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable protected: friend class INFO::InfoSingle; bool GetBool(int condition, int contextWindow = 0, const CGUIListItem *item=NULL); - int TranslateSingleString(const CStdString &strCondition, bool &listItemDependent); + int TranslateSingleString(const std::string &strCondition, bool &listItemDependent); // routines for window retrieval bool CheckWindowCondition(CGUIWindow *window, int condition) const; @@ -861,22 +861,22 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable class Property { public: - Property(const CStdString &property, const CStdString ¶meters); + Property(const std::string &property, const std::string ¶meters); const std::string ¶m(unsigned int n = 0) const; unsigned int num_params() const; - CStdString name; + std::string name; private: std::vector params; }; bool GetMultiInfoBool(const GUIInfo &info, int contextWindow = 0, const CGUIListItem *item = NULL); bool GetMultiInfoInt(int &value, const GUIInfo &info, int contextWindow = 0) const; - CStdString GetMultiInfoLabel(const GUIInfo &info, int contextWindow = 0, std::string *fallback = NULL); + std::string GetMultiInfoLabel(const GUIInfo &info, int contextWindow = 0, std::string *fallback = NULL); int TranslateListItem(const Property &info); - int TranslateMusicPlayerString(const CStdString &info) const; - TIME_FORMAT TranslateTimeFormat(const CStdString &format); + int TranslateMusicPlayerString(const std::string &info) const; + TIME_FORMAT TranslateTimeFormat(const std::string &format); bool GetItemBool(const CGUIListItem *item, int condition) const; /*! \brief Split an info string into it's constituent parts and parameters @@ -889,13 +889,13 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable \param infoString the original string \param info the resulting pairs of info and parameters. */ - void SplitInfoString(const CStdString &infoString, std::vector &info); + void SplitInfoString(const std::string &infoString, std::vector &info); // Conditional string parameters for testing are stored in a vector for later retrieval. // The offset into the string parameters array is returned. - int ConditionalStringParameter(const CStdString &strParameter, bool caseSensitive = false); + int ConditionalStringParameter(const std::string &strParameter, bool caseSensitive = false); int AddMultiInfo(const GUIInfo &info); - int AddListItemProp(const CStdString &str, int offset=0); + int AddListItemProp(const std::string &str, int offset=0); /*! * @brief Get the EPG tag that is currently active @@ -911,11 +911,11 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable std::vector m_multiInfo; std::vector m_listitemProperties; - CStdString m_currentMovieDuration; + std::string m_currentMovieDuration; // Current playing stuff CFileItem* m_currentFile; - CStdString m_currentMovieThumb; + std::string m_currentMovieThumb; CFileItem* m_currentSlide; // fan stuff diff --git a/xbmc/GUILargeTextureManager.cpp b/xbmc/GUILargeTextureManager.cpp index ba1e0044d6485..0450ffe98743f 100644 --- a/xbmc/GUILargeTextureManager.cpp +++ b/xbmc/GUILargeTextureManager.cpp @@ -32,7 +32,7 @@ using namespace std; -CImageLoader::CImageLoader(const CStdString &path, const bool useCache) +CImageLoader::CImageLoader(const std::string &path, const bool useCache) { m_path = path; m_texture = NULL; @@ -47,9 +47,9 @@ CImageLoader::~CImageLoader() bool CImageLoader::DoWork() { bool needsChecking = false; - CStdString loadPath; + std::string loadPath; - CStdString texturePath = g_TextureManager.GetTexturePath(m_path); + std::string texturePath = g_TextureManager.GetTexturePath(m_path); if (m_use_cache) loadPath = CTextureCache::Get().CheckCachedImage(texturePath, true, needsChecking); else @@ -78,7 +78,7 @@ bool CImageLoader::DoWork() return true; } -CGUILargeTextureManager::CLargeTexture::CLargeTexture(const CStdString &path) +CGUILargeTextureManager::CLargeTexture::CLargeTexture(const std::string &path) { m_path = path; m_refCount = 1; @@ -153,7 +153,7 @@ void CGUILargeTextureManager::CleanupUnusedImages(bool immediately) // if available, increment reference count, and return the image. // else, add to the queue list if appropriate. -bool CGUILargeTextureManager::GetImage(const CStdString &path, CTextureArray &texture, bool firstRequest, const bool useCache) +bool CGUILargeTextureManager::GetImage(const std::string &path, CTextureArray &texture, bool firstRequest, const bool useCache) { CSingleLock lock(m_listSection); for (listIterator it = m_allocated.begin(); it != m_allocated.end(); ++it) @@ -174,7 +174,7 @@ bool CGUILargeTextureManager::GetImage(const CStdString &path, CTextureArray &te return true; } -void CGUILargeTextureManager::ReleaseImage(const CStdString &path, bool immediately) +void CGUILargeTextureManager::ReleaseImage(const std::string &path, bool immediately) { CSingleLock lock(m_listSection); for (listIterator it = m_allocated.begin(); it != m_allocated.end(); ++it) @@ -202,7 +202,7 @@ void CGUILargeTextureManager::ReleaseImage(const CStdString &path, bool immediat } // queue the image, and start the background loader if necessary -void CGUILargeTextureManager::QueueImage(const CStdString &path, bool useCache) +void CGUILargeTextureManager::QueueImage(const std::string &path, bool useCache) { CSingleLock lock(m_listSection); for (queueIterator it = m_queued.begin(); it != m_queued.end(); ++it) diff --git a/xbmc/GUILargeTextureManager.h b/xbmc/GUILargeTextureManager.h index 4bc957a289b32..108cbdbad2fdc 100644 --- a/xbmc/GUILargeTextureManager.h +++ b/xbmc/GUILargeTextureManager.h @@ -35,7 +35,7 @@ class CImageLoader : public CJob { public: - CImageLoader(const CStdString &path, const bool useCache); + CImageLoader(const std::string &path, const bool useCache); virtual ~CImageLoader(); /*! @@ -44,7 +44,7 @@ class CImageLoader : public CJob virtual bool DoWork(); bool m_use_cache; ///< Whether or not to use any caching with this image - CStdString m_path; ///< path of image to load + std::string m_path; ///< path of image to load CBaseTexture *m_texture; ///< Texture object to load the image into \sa CBaseTexture. }; @@ -86,7 +86,7 @@ class CGUILargeTextureManager : public IJobCallback \return true if the image exists, else false. \sa CGUITextureArray and CGUITexture */ - bool GetImage(const CStdString &path, CTextureArray &texture, bool firstRequest, bool useCache = true); + bool GetImage(const std::string &path, CTextureArray &texture, bool firstRequest, bool useCache = true); /*! \brief Request a texture to be unloaded. @@ -99,7 +99,7 @@ class CGUILargeTextureManager : public IJobCallback \param immediately if set true the image is immediately unloaded once its reference count reaches zero rather than being unloaded after a delay. */ - void ReleaseImage(const CStdString &path, bool immediately = false); + void ReleaseImage(const std::string &path, bool immediately = false); /*! \brief Cleanup images that are no longer in use. @@ -116,7 +116,7 @@ class CGUILargeTextureManager : public IJobCallback class CLargeTexture { public: - CLargeTexture(const CStdString &path); + CLargeTexture(const std::string &path); virtual ~CLargeTexture(); void AddRef(); @@ -124,19 +124,19 @@ class CGUILargeTextureManager : public IJobCallback bool DeleteIfRequired(bool deleteImmediately = false); void SetTexture(CBaseTexture* texture); - const CStdString &GetPath() const { return m_path; }; + const std::string &GetPath() const { return m_path; }; const CTextureArray &GetTexture() const { return m_texture; }; private: static const unsigned int TIME_TO_DELETE = 2000; unsigned int m_refCount; - CStdString m_path; + std::string m_path; CTextureArray m_texture; unsigned int m_timeToDelete; }; - void QueueImage(const CStdString &path, bool useCache = true); + void QueueImage(const std::string &path, bool useCache = true); std::vector< std::pair > m_queued; std::vector m_allocated; diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp index ff8637c694d89..3fe2b0a9b4bfc 100644 --- a/xbmc/GUIPassword.cpp +++ b/xbmc/GUIPassword.cpp @@ -46,7 +46,7 @@ CGUIPassword::CGUIPassword(void) CGUIPassword::~CGUIPassword(void) {} -bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType) +bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const std::string &strType) { // \brief Tests if the user is allowed to access the share folder // \param pItem The share folder item to access @@ -57,8 +57,8 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType) while (pItem->m_iHasLock > 1) { - CStdString strLockCode = pItem->m_strLockCode; - CStdString strLabel = pItem->GetLabel(); + std::string strLockCode = pItem->m_strLockCode; + std::string strLabel = pItem->GetLabel(); int iResult = 0; // init to user succeeded state, doing this to optimize switch statement below char buffer[33]; // holds 32 places plus sign character if(g_passwordManager.bMasterUser)// Check if we are the MasterUser! @@ -73,7 +73,7 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType) return false; } // show the appropriate lock dialog - CStdString strHeading = ""; + std::string strHeading = ""; if (pItem->m_bIsFolder) strHeading = g_localizeStrings.Get(12325); else @@ -124,11 +124,11 @@ bool CGUIPassword::CheckStartUpLock() { // prompt user for mastercode if the mastercode was set b4 or by xml int iVerifyPasswordResult = -1; - CStdString strHeader = g_localizeStrings.Get(20075); + std::string strHeader = g_localizeStrings.Get(20075); if (iMasterLockRetriesLeft == -1) iMasterLockRetriesLeft = CSettings::Get().GetInt("masterlock.maxretries"); if (g_passwordManager.iMasterLockRetriesLeft == 0) g_passwordManager.iMasterLockRetriesLeft = 1; - CStdString strPassword = CProfilesManager::Get().GetMasterProfile().getLockCode(); + std::string strPassword = CProfilesManager::Get().GetMasterProfile().getLockCode(); if (CProfilesManager::Get().GetMasterProfile().getLockMode() == 0) iVerifyPasswordResult = 0; else @@ -138,10 +138,10 @@ bool CGUIPassword::CheckStartUpLock() iVerifyPasswordResult = VerifyPassword(CProfilesManager::Get().GetMasterProfile().getLockMode(), strPassword, strHeader); if (iVerifyPasswordResult != 0 ) { - CStdString strLabel1; + std::string strLabel1; strLabel1 = g_localizeStrings.Get(12343); int iLeft = g_passwordManager.iMasterLockRetriesLeft-i; - CStdString strLabel = StringUtils::Format("%i %s", iLeft, strLabel1.c_str()); + std::string strLabel = StringUtils::Format("%i %s", iLeft, strLabel1.c_str()); // PopUp OK and Display: MasterLock mode has changed but no new Mastercode has been set! CGUIDialogOK::ShowAndGetInput(12360, 12367, 12368, strLabel); @@ -245,8 +245,8 @@ bool CGUIPassword::IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled) // no, unlock since we are allowed to prompt int iVerifyPasswordResult = -1; - CStdString strHeading = g_localizeStrings.Get(20075); - CStdString strPassword = CProfilesManager::Get().GetMasterProfile().getLockCode(); + std::string strHeading = g_localizeStrings.Get(20075); + std::string strPassword = CProfilesManager::Get().GetMasterProfile().getLockCode(); iVerifyPasswordResult = VerifyPassword(CProfilesManager::Get().GetMasterProfile().getLockMode(), strPassword, strHeading); if (1 == iVerifyPasswordResult) UpdateMasterLockRetryCount(false); @@ -286,7 +286,7 @@ void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount) return ; } } - CStdString dlgLine1 = ""; + std::string dlgLine1 = ""; if (0 < g_passwordManager.iMasterLockRetriesLeft) dlgLine1 = StringUtils::Format("%d %s", g_passwordManager.iMasterLockRetriesLeft, @@ -297,21 +297,21 @@ void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount) g_passwordManager.iMasterLockRetriesLeft = CSettings::Get().GetInt("masterlock.maxretries"); // user entered correct mastercode, reset retries to max allowed } -bool CGUIPassword::CheckLock(LockType btnType, const CStdString& strPassword, int iHeading) +bool CGUIPassword::CheckLock(LockType btnType, const std::string& strPassword, int iHeading) { bool bDummy; return CheckLock(btnType,strPassword,iHeading,bDummy); } -bool CGUIPassword::CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled) +bool CGUIPassword::CheckLock(LockType btnType, const std::string& strPassword, int iHeading, bool& bCanceled) { bCanceled = false; - if (btnType == LOCK_MODE_EVERYONE || strPassword.Equals("-") || + if (btnType == LOCK_MODE_EVERYONE || strPassword == "-" || CProfilesManager::Get().GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE || g_passwordManager.bMasterUser) return true; int iVerifyPasswordResult = -1; - CStdString strHeading = g_localizeStrings.Get(iHeading); + std::string strHeading = g_localizeStrings.Get(iHeading); iVerifyPasswordResult = VerifyPassword(btnType, strPassword, strHeading); if (iVerifyPasswordResult == -1) @@ -423,7 +423,7 @@ bool CGUIPassword::CheckMenuLock(int iWindowID) return true; } -bool CGUIPassword::LockSource(const CStdString& strType, const CStdString& strName, bool bState) +bool CGUIPassword::LockSource(const std::string& strType, const std::string& strName, bool bState) { VECSOURCES* pShares = CMediaSourceSettings::Get().GetSources(strType); bool bResult = false; @@ -480,7 +480,7 @@ void CGUIPassword::RemoveSourceLocks() g_windowManager.SendThreadMessage(msg); } -bool CGUIPassword::IsDatabasePathUnlocked(const CStdString& strPath, VECSOURCES& vecSources) +bool CGUIPassword::IsDatabasePathUnlocked(const std::string& strPath, VECSOURCES& vecSources) { if (g_passwordManager.bMasterUser || CProfilesManager::Get().GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE) return true; @@ -506,19 +506,19 @@ void CGUIPassword::OnSettingAction(const CSetting *setting) SetMasterLockMode(); } -int CGUIPassword::VerifyPassword(LockType btnType, const CStdString& strPassword, const CStdString& strHeading) +int CGUIPassword::VerifyPassword(LockType btnType, const std::string& strPassword, const std::string& strHeading) { int iVerifyPasswordResult; switch (btnType) { case LOCK_MODE_NUMERIC: - iVerifyPasswordResult = CGUIDialogNumeric::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); + iVerifyPasswordResult = CGUIDialogNumeric::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); break; case LOCK_MODE_GAMEPAD: - iVerifyPasswordResult = CGUIDialogGamepad::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); + iVerifyPasswordResult = CGUIDialogGamepad::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); break; case LOCK_MODE_QWERTY: - iVerifyPasswordResult = CGUIKeyboardFactory::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); + iVerifyPasswordResult = CGUIKeyboardFactory::ShowAndVerifyPassword(const_cast(strPassword), strHeading, 0); break; default: // must not be supported, treat as unlocked iVerifyPasswordResult = 0; diff --git a/xbmc/GUIPassword.h b/xbmc/GUIPassword.h index a090a82da211d..490e1496160b3 100644 --- a/xbmc/GUIPassword.h +++ b/xbmc/GUIPassword.h @@ -21,10 +21,10 @@ */ #include +#include #include #include "settings/lib/ISettingCallback.h" -#include "utils/StdString.h" #include "settings/lib/Setting.h" class CFileItem; @@ -62,10 +62,10 @@ class CGUIPassword : public ISettingCallback public: CGUIPassword(void); virtual ~CGUIPassword(void); - bool IsItemUnlocked(CFileItem* pItem, const CStdString &strType); - bool IsItemUnlocked(CMediaSource* pItem, const CStdString &strType); - bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading); - bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled); + bool IsItemUnlocked(CFileItem* pItem, const std::string &strType); + bool IsItemUnlocked(CMediaSource* pItem, const std::string &strType); + bool CheckLock(LockType btnType, const std::string& strPassword, int iHeading); + bool CheckLock(LockType btnType, const std::string& strPassword, int iHeading, bool& bCanceled); bool IsProfileLockUnlocked(int iProfile=-1); bool IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt = true); bool IsMasterLockUnlocked(bool bPromptUser); @@ -82,10 +82,10 @@ class CGUIPassword : public ISettingCallback bool CheckSettingLevelLock(const SettingLevel& level, bool enforce = false); bool CheckMenuLock(int iWindowID); bool SetMasterLockMode(bool bDetails=true); - bool LockSource(const CStdString& strType, const CStdString& strName, bool bState); + bool LockSource(const std::string& strType, const std::string& strName, bool bState); void LockSources(bool lock); void RemoveSourceLocks(); - bool IsDatabasePathUnlocked(const CStdString& strPath, VECSOURCES& vecSources); + bool IsDatabasePathUnlocked(const std::string& strPath, VECSOURCES& vecSources); virtual void OnSettingAction(const CSetting *setting); @@ -93,7 +93,7 @@ class CGUIPassword : public ISettingCallback int iMasterLockRetriesLeft; private: - int VerifyPassword(LockType btnType, const CStdString& strPassword, const CStdString& strHeading); + int VerifyPassword(LockType btnType, const std::string& strPassword, const std::string& strHeading); }; extern CGUIPassword g_passwordManager; diff --git a/xbmc/GUIUserMessages.h b/xbmc/GUIUserMessages.h index 9ffec7f01f313..89188ffe6ba5c 100644 --- a/xbmc/GUIUserMessages.h +++ b/xbmc/GUIUserMessages.h @@ -31,8 +31,8 @@ // General playlist items changed #define GUI_MSG_PLAYLIST_CHANGED GUI_MSG_USER + 3 -// Start Slideshow in my pictures lpVoid = CStdString -// Param lpVoid: CStdString* that points to the Directory +// Start Slideshow in my pictures lpVoid = std::string +// Param lpVoid: std::string* that points to the Directory // to start the slideshow in. #define GUI_MSG_START_SLIDESHOW GUI_MSG_USER + 4 diff --git a/xbmc/MediaSource.cpp b/xbmc/MediaSource.cpp index ec03caaccedbb..4935f042dcd48 100644 --- a/xbmc/MediaSource.cpp +++ b/xbmc/MediaSource.cpp @@ -34,7 +34,7 @@ bool CMediaSource::IsWritable() const return CUtil::SupportsWriteFileOperations(strPath); } -void CMediaSource::FromNameAndPaths(const CStdString &category, const CStdString &name, const vector &paths) +void CMediaSource::FromNameAndPaths(const std::string &category, const std::string &name, const vector &paths) { vecPaths = paths; if (paths.size() == 0) @@ -97,7 +97,7 @@ void AddOrReplace(VECSOURCES& sources, const VECSOURCES& extras) unsigned int j; for ( j=0;j #include #include "GUIPassword.h" @@ -46,12 +46,12 @@ class CMediaSource bool operator==(const CMediaSource &right) const; - void FromNameAndPaths(const CStdString &category, const CStdString &name, const std::vector &paths); + void FromNameAndPaths(const std::string &category, const std::string &name, const std::vector &paths); bool IsWritable() const; - CStdString strName; ///< Name of the share, can be choosen freely. - CStdString strStatus; ///< Status of the share (eg has disk etc.) - CStdString strDiskUniqueId; ///< removable:// + DVD Label + DVD ID for resume point storage, if available - CStdString strPath; ///< Path of the share, eg. iso9660:// or F: + std::string strName; ///< Name of the share, can be choosen freely. + std::string strStatus; ///< Status of the share (eg has disk etc.) + std::string strDiskUniqueId; ///< removable:// + DVD Label + DVD ID for resume point storage, if available + std::string strPath; ///< Path of the share, eg. iso9660:// or F: /*! \brief The type of the media source. @@ -90,11 +90,11 @@ class CMediaSource Value is unknown or unspecified. */ LockType m_iLockMode; - CStdString m_strLockCode; ///< Input code for Lock UI to verify, can be chosen freely. + std::string m_strLockCode; ///< Input code for Lock UI to verify, can be chosen freely. int m_iHasLock; int m_iBadPwdCount; ///< Number of wrong passwords user has entered since share was last unlocked - CStdString m_strThumbnailImage; ///< Path to a thumbnail image for the share, or blank for default + std::string m_strThumbnailImage; ///< Path to a thumbnail image for the share, or blank for default std::vector vecPaths; bool m_ignore; /// Content()); @@ -158,7 +158,7 @@ int CNfoFile::Scrape(ScraperPtr& scraper) return m_scurl.m_url.empty() ? 1 : 0; } -int CNfoFile::Load(const CStdString& strFile) +int CNfoFile::Load(const std::string& strFile) { Close(); XFILE::CFile file; diff --git a/xbmc/NfoFile.h b/xbmc/NfoFile.h index 8672ab2b2e75d..b86739df1aedf 100644 --- a/xbmc/NfoFile.h +++ b/xbmc/NfoFile.h @@ -25,10 +25,10 @@ #define AFX_NfoFile_H__641CCF68_6D2A_426E_9204_C0E4BEF12D00__INCLUDED_ #pragma once +#include #include "addons/Scraper.h" #include "utils/CharsetConverter.h" -#include "utils/StdString.h" class CNfoFile { @@ -45,7 +45,7 @@ class CNfoFile ERROR_NFO = 4 }; - NFOResult Create(const CStdString&, const ADDON::ScraperPtr&, int episode=-1); + NFOResult Create(const std::string&, const ADDON::ScraperPtr&, int episode=-1); template bool GetDetails(T& details,const char* document=NULL, bool prioritise=false) { @@ -73,7 +73,7 @@ class CNfoFile ADDON::TYPE m_type; CScraperUrl m_scurl; - int Load(const CStdString&); + int Load(const std::string&); int Scrape(ADDON::ScraperPtr& scraper); }; diff --git a/xbmc/PartyModeManager.cpp b/xbmc/PartyModeManager.cpp index 5348c74227eca..fe95bf03535e9 100644 --- a/xbmc/PartyModeManager.cpp +++ b/xbmc/PartyModeManager.cpp @@ -55,11 +55,11 @@ CPartyModeManager::~CPartyModeManager(void) { } -bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUSIC*/, const CStdString& strXspPath /*= ""*/) +bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUSIC*/, const std::string& strXspPath /*= ""*/) { // Filter using our PartyMode xml file CSmartPlaylist playlist; - CStdString partyModePath; + std::string partyModePath; bool playlistLoaded; m_bIsVideo = context == PARTYMODECONTEXT_VIDEO; @@ -78,13 +78,15 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS if (context == PARTYMODECONTEXT_UNKNOWN) { //get it from the xsp file - m_bIsVideo = (m_type.Equals("video") || m_type.Equals("musicvideos") || m_type.Equals("mixed")); + m_bIsVideo = (StringUtils::EqualsNoCase(m_type, "video") || + StringUtils::EqualsNoCase(m_type, "musicvideos") || + StringUtils::EqualsNoCase(m_type, "mixed")); } - if (m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "mixed")) playlist.SetType("songs"); - if (m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "mixed")) playlist.SetType("video"); playlist.SetType(m_type); @@ -108,7 +110,8 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS ClearState(); unsigned int time = XbmcThreads::SystemClockMillis(); vector< pair > songIDs; - if (m_type.Equals("songs") || m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "songs") || + StringUtils::EqualsNoCase(m_type, "mixed")) { CMusicDatabase db; if (db.Open()) @@ -119,24 +122,25 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS CLog::Log(LOGINFO, "PARTY MODE MANAGER: Registering filter:[%s]", m_strCurrentFilterMusic.c_str()); m_iMatchingSongs = (int)db.GetSongIDs(m_strCurrentFilterMusic, songIDs); - if (m_iMatchingSongs < 1 && m_type.Equals("songs")) + if (m_iMatchingSongs < 1 && StringUtils::EqualsNoCase(m_type, "songs")) { pDialog->Close(); db.Close(); - OnError(16031, (CStdString)"Party mode found no matching songs. Aborting."); + OnError(16031, (std::string)"Party mode found no matching songs. Aborting."); return false; } } else { pDialog->Close(); - OnError(16033, (CStdString)"Party mode could not open database. Aborting."); + OnError(16033, (std::string)"Party mode could not open database. Aborting."); return false; } db.Close(); } - if (m_type.Equals("musicvideos") || m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "musicvideos") || + StringUtils::EqualsNoCase(m_type, "mixed")) { vector< pair > songIDs2; CVideoDatabase db; @@ -152,14 +156,14 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS { pDialog->Close(); db.Close(); - OnError(16031, (CStdString)"Party mode found no matching songs. Aborting."); + OnError(16031, (std::string)"Party mode found no matching songs. Aborting."); return false; } } else { pDialog->Close(); - OnError(16033, (CStdString)"Party mode could not open database. Aborting."); + OnError(16033, (std::string)"Party mode could not open database. Aborting."); return false; } db.Close(); @@ -200,7 +204,7 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS pDialog->Close(); // open now playing window - if (m_type.Equals("songs")) + if (StringUtils::EqualsNoCase(m_type, "songs")) { if (g_windowManager.GetActiveWindow() != WINDOW_MUSIC_PLAYLIST) g_windowManager.ActivateWindow(WINDOW_MUSIC_PLAYLIST); @@ -311,7 +315,7 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) // distribute between types if mixed int iSongsToAdd=iSongs; int iVidsToAdd=iSongs; - if (m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "mixed")) { if (iSongs == 1) { @@ -330,7 +334,8 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) } // add songs to fill queue - if (m_type.Equals("songs") || m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "songs") || + StringUtils::EqualsNoCase(m_type, "mixed")) { CMusicDatabase database; if (database.Open()) @@ -348,7 +353,7 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) bool error(false); for (int i = 0; i < iSongsToAdd; i++) { - pair whereClause = GetWhereClauseWithHistory(); + pair whereClause = GetWhereClauseWithHistory(); CFileItemPtr item(new CFileItem); int songID; if (database.GetRandomSong(item.get(), songID, whereClause.first)) @@ -366,18 +371,19 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) if (error) { database.Close(); - OnError(16034, (CStdString)"Cannot get songs from database. Aborting."); + OnError(16034, (std::string)"Cannot get songs from database. Aborting."); return false; } } else { - OnError(16033, (CStdString)"Party mode could not open database. Aborting."); + OnError(16033, (std::string)"Party mode could not open database. Aborting."); return false; } database.Close(); } - if (m_type.Equals("musicvideos") || m_type.Equals("mixed")) + if (StringUtils::EqualsNoCase(m_type, "musicvideos") || + StringUtils::EqualsNoCase(m_type, "mixed")) { CVideoDatabase database; if (database.Open()) @@ -395,7 +401,7 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) bool error(false); for (int i = 0; i < iVidsToAdd; i++) { - pair whereClause = GetWhereClauseWithHistory(); + pair whereClause = GetWhereClauseWithHistory(); CFileItemPtr item(new CFileItem); int songID; if (database.GetRandomMusicVideo(item.get(), songID, whereClause.second)) @@ -413,13 +419,13 @@ bool CPartyModeManager::AddRandomSongs(int iSongs /* = 0 */) if (error) { database.Close(); - OnError(16034, (CStdString)"Cannot get songs from database. Aborting."); + OnError(16034, (std::string)"Cannot get songs from database. Aborting."); return false; } } else { - OnError(16033, (CStdString)"Party mode could not open database. Aborting."); + OnError(16033, (std::string)"Party mode could not open database. Aborting."); return false; } database.Close(); @@ -504,7 +510,7 @@ void CPartyModeManager::Play(int iPos) Process(); } -void CPartyModeManager::OnError(int iError, const CStdString& strLogMessage) +void CPartyModeManager::OnError(int iError, const std::string& strLogMessage) { // open error dialog CGUIDialogOK::ShowAndGetInput(257, 16030, iError, 0); @@ -601,12 +607,12 @@ bool CPartyModeManager::AddInitialSongs(vector > &songIDs) vector > chosenSongIDs; GetRandomSelection(songIDs, iMissingSongs, chosenSongIDs); - CStdString sqlWhereMusic = "songview.idSong IN ("; - CStdString sqlWhereVideo = "idMVideo IN ("; + std::string sqlWhereMusic = "songview.idSong IN ("; + std::string sqlWhereVideo = "idMVideo IN ("; for (vector< pair >::iterator it = chosenSongIDs.begin(); it != chosenSongIDs.end(); it++) { - CStdString song = StringUtils::Format("%i,", it->second); + std::string song = StringUtils::Format("%i,", it->second); if (it->first == 1) sqlWhereMusic += song; if (it->first == 2) @@ -642,7 +648,7 @@ bool CPartyModeManager::AddInitialSongs(vector > &songIDs) return true; } -pair CPartyModeManager::GetWhereClauseWithHistory() const +pair CPartyModeManager::GetWhereClauseWithHistory() const { // now add this on to the normal where clause std::vector historyItemsMusic; diff --git a/xbmc/PartyModeManager.h b/xbmc/PartyModeManager.h index ef5719b898835..b7ac7b9b13b1c 100644 --- a/xbmc/PartyModeManager.h +++ b/xbmc/PartyModeManager.h @@ -19,7 +19,8 @@ * */ -#include "utils/StdString.h" +#include +#include #include @@ -43,7 +44,7 @@ class CPartyModeManager CPartyModeManager(void); virtual ~CPartyModeManager(void); - bool Enable(PartyModeContext context=PARTYMODECONTEXT_MUSIC, const CStdString& strXspPath = ""); + bool Enable(PartyModeContext context=PARTYMODECONTEXT_MUSIC, const std::string& strXspPath = ""); void Disable(); void Play(int iPos); void OnSongChange(bool bUpdatePlayed = false); @@ -66,10 +67,10 @@ class CPartyModeManager bool ReapSongs(); bool MovePlaying(); void SendUpdateMessage(); - void OnError(int iError, const CStdString& strLogMessage); + void OnError(int iError, const std::string& strLogMessage); void ClearState(); void UpdateStats(); - std::pair GetWhereClauseWithHistory() const; + std::pair GetWhereClauseWithHistory() const; void AddToHistory(int type, int songID); void GetRandomSelection(std::vector< std::pair > &in, unsigned int number, std::vector< std::pair > &out); void Announce(); @@ -78,9 +79,9 @@ class CPartyModeManager bool m_bEnabled; bool m_bIsVideo; int m_iLastUserSong; - CStdString m_strCurrentFilterMusic; - CStdString m_strCurrentFilterVideo; - CStdString m_type; + std::string m_strCurrentFilterMusic; + std::string m_strCurrentFilterVideo; + std::string m_type; // statistics int m_iSongsPlayed; diff --git a/xbmc/PasswordManager.cpp b/xbmc/PasswordManager.cpp index 68a439d13ec83..3579078702be9 100644 --- a/xbmc/PasswordManager.cpp +++ b/xbmc/PasswordManager.cpp @@ -46,8 +46,8 @@ bool CPasswordManager::AuthenticateURL(CURL &url) if (!m_loaded) Load(); - CStdString lookup(GetLookupPath(url)); - map::const_iterator it = m_temporaryCache.find(lookup); + std::string lookup(GetLookupPath(url)); + map::const_iterator it = m_temporaryCache.find(lookup); if (it == m_temporaryCache.end()) { // second step, try something that doesn't quite match it = m_temporaryCache.find(GetServerLookup(lookup)); @@ -89,8 +89,8 @@ void CPasswordManager::SaveAuthenticatedURL(const CURL &url, bool saveToProfile) CSingleLock lock(m_critSection); - CStdString path = GetLookupPath(url); - CStdString authenticatedPath = url.Get(); + std::string path = GetLookupPath(url); + std::string authenticatedPath = url.Get(); if (!m_loaded) Load(); @@ -116,7 +116,7 @@ void CPasswordManager::Clear() void CPasswordManager::Load() { Clear(); - CStdString passwordsFile = CProfilesManager::Get().GetUserDataItem("passwords.xml"); + std::string passwordsFile = CProfilesManager::Get().GetUserDataItem("passwords.xml"); if (XFILE::CFile::Exists(passwordsFile)) { CXBMCTinyXML doc; @@ -133,7 +133,7 @@ void CPasswordManager::Load() const TiXmlElement *path = root->FirstChildElement("path"); while (path) { - CStdString from, to; + std::string from, to; if (XMLUtils::GetPath(path, "from", from) && XMLUtils::GetPath(path, "to", to)) { m_permanentCache[from] = to; @@ -157,7 +157,7 @@ void CPasswordManager::Save() const if (!root) return; - for (map::const_iterator i = m_permanentCache.begin(); i != m_permanentCache.end(); ++i) + for (map::const_iterator i = m_permanentCache.begin(); i != m_permanentCache.end(); ++i) { TiXmlElement pathElement("path"); TiXmlNode *path = root->InsertEndChild(pathElement); @@ -168,12 +168,12 @@ void CPasswordManager::Save() const doc.SaveFile(CProfilesManager::Get().GetUserDataItem("passwords.xml")); } -CStdString CPasswordManager::GetLookupPath(const CURL &url) const +std::string CPasswordManager::GetLookupPath(const CURL &url) const { return "smb://" + url.GetHostName() + "/" + url.GetShareName(); } -CStdString CPasswordManager::GetServerLookup(const CStdString &path) const +std::string CPasswordManager::GetServerLookup(const std::string &path) const { CURL url(path); return "smb://" + url.GetHostName() + "/"; diff --git a/xbmc/PasswordManager.h b/xbmc/PasswordManager.h index 5f74bae857241..b2db8ef310a28 100644 --- a/xbmc/PasswordManager.h +++ b/xbmc/PasswordManager.h @@ -19,8 +19,9 @@ * */ -#include "utils/StdString.h" #include +#include +#include #include "threads/CriticalSection.h" class CURL; @@ -92,11 +93,11 @@ class CPasswordManager void Load(); void Save() const; - CStdString GetLookupPath(const CURL &url) const; - CStdString GetServerLookup(const CStdString &path) const; + std::string GetLookupPath(const CURL &url) const; + std::string GetServerLookup(const std::string &path) const; - std::map m_temporaryCache; - std::map m_permanentCache; + std::map m_temporaryCache; + std::map m_permanentCache; bool m_loaded; CCriticalSection m_critSection; diff --git a/xbmc/PlayListPlayer.cpp b/xbmc/PlayListPlayer.cpp index 5f5955eeac849..c6f210e9fb682 100644 --- a/xbmc/PlayListPlayer.cpp +++ b/xbmc/PlayListPlayer.cpp @@ -487,7 +487,7 @@ void CPlayListPlayer::SetShuffle(int iPlaylist, bool bYesNo, bool bNotify /* = f if (bNotify) { - CStdString shuffleStr = StringUtils::Format("%s: %s", g_localizeStrings.Get(191).c_str(), g_localizeStrings.Get(bYesNo ? 593 : 591).c_str()); // Shuffle: All/Off + std::string shuffleStr = StringUtils::Format("%s: %s", g_localizeStrings.Get(191).c_str(), g_localizeStrings.Get(bYesNo ? 593 : 591).c_str()); // Shuffle: All/Off CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(559), shuffleStr); } diff --git a/xbmc/SectionLoader.cpp b/xbmc/SectionLoader.cpp index a4970f565bed0..9ff9c86c2e9ab 100644 --- a/xbmc/SectionLoader.cpp +++ b/xbmc/SectionLoader.cpp @@ -25,6 +25,7 @@ #include "threads/SingleLock.h" #include "utils/log.h" #include "utils/TimeUtils.h" +#include "utils/StringUtils.h" using namespace std; @@ -44,16 +45,16 @@ CSectionLoader::~CSectionLoader(void) UnloadAll(); } -LibraryLoader *CSectionLoader::LoadDLL(const CStdString &dllname, bool bDelayUnload /*=true*/, bool bLoadSymbols /*=false*/) +LibraryLoader *CSectionLoader::LoadDLL(const std::string &dllname, bool bDelayUnload /*=true*/, bool bLoadSymbols /*=false*/) { CSingleLock lock(g_sectionLoader.m_critSection); - if (!dllname) return NULL; + if (dllname.empty()) return NULL; // check if it's already loaded, and increase the reference count if so for (int i = 0; i < (int)g_sectionLoader.m_vecLoadedDLLs.size(); ++i) { CDll& dll = g_sectionLoader.m_vecLoadedDLLs[i]; - if (dll.m_strDllName.Equals(dllname)) + if (StringUtils::EqualsNoCase(dll.m_strDllName, dllname)) { dll.m_lReferenceCount++; return dll.m_pDll; @@ -76,16 +77,16 @@ LibraryLoader *CSectionLoader::LoadDLL(const CStdString &dllname, bool bDelayUnl return newDLL.m_pDll; } -void CSectionLoader::UnloadDLL(const CStdString &dllname) +void CSectionLoader::UnloadDLL(const std::string &dllname) { CSingleLock lock(g_sectionLoader.m_critSection); - if (!dllname) return; + if (dllname.empty()) return; // check if it's already loaded, and decrease the reference count if so for (int i = 0; i < (int)g_sectionLoader.m_vecLoadedDLLs.size(); ++i) { CDll& dll = g_sectionLoader.m_vecLoadedDLLs[i]; - if (dll.m_strDllName.Equals(dllname)) + if (StringUtils::EqualsNoCase(dll.m_strDllName, dllname)) { dll.m_lReferenceCount--; if (0 == dll.m_lReferenceCount) diff --git a/xbmc/SectionLoader.h b/xbmc/SectionLoader.h index f45ce0f426434..487e2612a32f8 100644 --- a/xbmc/SectionLoader.h +++ b/xbmc/SectionLoader.h @@ -19,7 +19,8 @@ * */ -#include "utils/StdString.h" +#include +#include #include "threads/CriticalSection.h" #include "utils/GlobalsHandling.h" @@ -32,7 +33,7 @@ class CSectionLoader class CDll { public: - CStdString m_strDllName; + std::string m_strDllName; long m_lReferenceCount; LibraryLoader *m_pDll; unsigned int m_unloadDelayStartTick; @@ -41,8 +42,8 @@ class CSectionLoader CSectionLoader(void); virtual ~CSectionLoader(void); - static LibraryLoader* LoadDLL(const CStdString& strSection, bool bDelayUnload=true, bool bLoadSymbols=false); - static void UnloadDLL(const CStdString& strSection); + static LibraryLoader* LoadDLL(const std::string& strSection, bool bDelayUnload=true, bool bLoadSymbols=false); + static void UnloadDLL(const std::string& strSection); static void UnloadDelayed(); void UnloadAll(); diff --git a/xbmc/Temperature.cpp b/xbmc/Temperature.cpp index c5dfa4256962c..5362037dfc3ad 100644 --- a/xbmc/Temperature.cpp +++ b/xbmc/Temperature.cpp @@ -23,6 +23,7 @@ #include "Temperature.h" #include "utils/StringUtils.h" #include "utils/Archive.h" +#include CTemperature::CTemperature() { @@ -44,8 +45,8 @@ CTemperature::CTemperature(double value) bool CTemperature::operator >(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); if (!IsValid() || !right.IsValid()) return false; @@ -63,8 +64,8 @@ bool CTemperature::operator >=(const CTemperature& right) const bool CTemperature::operator <(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); if (!IsValid() || !right.IsValid()) return false; @@ -82,8 +83,8 @@ bool CTemperature::operator <=(const CTemperature& right) const bool CTemperature::operator ==(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); if (!IsValid() || !right.IsValid()) return false; @@ -108,8 +109,8 @@ const CTemperature& CTemperature::operator =(const CTemperature& right) const CTemperature& CTemperature::operator +=(const CTemperature& right) { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); m_value+=right.m_value; return *this; @@ -117,8 +118,8 @@ const CTemperature& CTemperature::operator +=(const CTemperature& right) const CTemperature& CTemperature::operator -=(const CTemperature& right) { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); m_value-=right.m_value; return *this; @@ -126,8 +127,8 @@ const CTemperature& CTemperature::operator -=(const CTemperature& right) const CTemperature& CTemperature::operator *=(const CTemperature& right) { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); m_value*=right.m_value; return *this; @@ -135,8 +136,8 @@ const CTemperature& CTemperature::operator *=(const CTemperature& right) const CTemperature& CTemperature::operator /=(const CTemperature& right) { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); m_value/=right.m_value; return *this; @@ -144,8 +145,8 @@ const CTemperature& CTemperature::operator /=(const CTemperature& right) CTemperature CTemperature::operator +(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); CTemperature temp(*this); @@ -159,8 +160,8 @@ CTemperature CTemperature::operator +(const CTemperature& right) const CTemperature CTemperature::operator -(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); CTemperature temp(*this); if (!IsValid() || !right.IsValid()) @@ -173,8 +174,8 @@ CTemperature CTemperature::operator -(const CTemperature& right) const CTemperature CTemperature::operator *(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); CTemperature temp(*this); if (!IsValid() || !right.IsValid()) @@ -186,8 +187,8 @@ CTemperature CTemperature::operator *(const CTemperature& right) const CTemperature CTemperature::operator /(const CTemperature& right) const { - ASSERT(IsValid()); - ASSERT(right.IsValid()); + assert(IsValid()); + assert(right.IsValid()); CTemperature temp(*this); if (!IsValid() || !right.IsValid()) @@ -199,7 +200,7 @@ CTemperature CTemperature::operator /(const CTemperature& right) const CTemperature& CTemperature::operator ++() { - ASSERT(IsValid()); + assert(IsValid()); m_value++; return *this; @@ -207,7 +208,7 @@ CTemperature& CTemperature::operator ++() CTemperature& CTemperature::operator --() { - ASSERT(IsValid()); + assert(IsValid()); m_value--; return *this; @@ -215,7 +216,7 @@ CTemperature& CTemperature::operator --() CTemperature CTemperature::operator ++(int) { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); m_value++; @@ -224,7 +225,7 @@ CTemperature CTemperature::operator ++(int) CTemperature CTemperature::operator --(int) { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); m_value--; @@ -233,7 +234,7 @@ CTemperature CTemperature::operator --(int) bool CTemperature::operator >(double right) const { - ASSERT(IsValid()); + assert(IsValid()); if (!IsValid()) return false; @@ -248,7 +249,7 @@ bool CTemperature::operator >=(double right) const bool CTemperature::operator <(double right) const { - ASSERT(IsValid()); + assert(IsValid()); if (!IsValid()) return false; @@ -276,7 +277,7 @@ bool CTemperature::operator !=(double right) const const CTemperature& CTemperature::operator +=(double right) { - ASSERT(IsValid()); + assert(IsValid()); m_value+=right; return *this; @@ -284,7 +285,7 @@ const CTemperature& CTemperature::operator +=(double right) const CTemperature& CTemperature::operator -=(double right) { - ASSERT(IsValid()); + assert(IsValid()); m_value-=right; return *this; @@ -292,7 +293,7 @@ const CTemperature& CTemperature::operator -=(double right) const CTemperature& CTemperature::operator *=(double right) { - ASSERT(IsValid()); + assert(IsValid()); m_value*=right; return *this; @@ -300,7 +301,7 @@ const CTemperature& CTemperature::operator *=(double right) const CTemperature& CTemperature::operator /=(double right) { - ASSERT(IsValid()); + assert(IsValid()); m_value/=right; return *this; @@ -308,7 +309,7 @@ const CTemperature& CTemperature::operator /=(double right) CTemperature CTemperature::operator +(double right) const { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); temp.m_value+=right; @@ -317,7 +318,7 @@ CTemperature CTemperature::operator +(double right) const CTemperature CTemperature::operator -(double right) const { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); temp.m_value-=right; @@ -326,7 +327,7 @@ CTemperature CTemperature::operator -(double right) const CTemperature CTemperature::operator *(double right) const { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); temp.m_value*=right; @@ -335,7 +336,7 @@ CTemperature CTemperature::operator *(double right) const CTemperature CTemperature::operator /(double right) const { - ASSERT(IsValid()); + assert(IsValid()); CTemperature temp(*this); temp.m_value/=right; @@ -477,7 +478,7 @@ double CTemperature::ToLocale() const value=ToNewton(); break; default: - ASSERT(false); + assert(false); break; } return value; diff --git a/xbmc/TextureCache.cpp b/xbmc/TextureCache.cpp index d7e55cf2d1d98..542183b9e1351 100644 --- a/xbmc/TextureCache.cpp +++ b/xbmc/TextureCache.cpp @@ -61,7 +61,7 @@ void CTextureCache::Deinitialize() m_database.Close(); } -bool CTextureCache::IsCachedImage(const CStdString &url) const +bool CTextureCache::IsCachedImage(const std::string &url) const { if (url != "-" && !CURL::IsFullPath(url)) return true; @@ -73,16 +73,16 @@ bool CTextureCache::IsCachedImage(const CStdString &url) const return false; } -bool CTextureCache::HasCachedImage(const CStdString &url) +bool CTextureCache::HasCachedImage(const std::string &url) { CTextureDetails details; - CStdString cachedImage(GetCachedImage(url, details)); + std::string cachedImage(GetCachedImage(url, details)); return (!cachedImage.empty() && cachedImage != url); } -CStdString CTextureCache::GetCachedImage(const CStdString &image, CTextureDetails &details, bool trackUsage) +std::string CTextureCache::GetCachedImage(const std::string &image, CTextureDetails &details, bool trackUsage) { - CStdString url = CTextureUtils::UnwrapImageURL(image); + std::string url = CTextureUtils::UnwrapImageURL(image); if (IsCachedImage(url)) return url; @@ -102,16 +102,16 @@ bool CTextureCache::CanCacheImageURL(const CURL &url) return (url.GetUserName().empty() || url.GetUserName() == "music"); } -CStdString CTextureCache::CheckCachedImage(const CStdString &url, bool returnDDS, bool &needsRecaching) +std::string CTextureCache::CheckCachedImage(const std::string &url, bool returnDDS, bool &needsRecaching) { CTextureDetails details; - CStdString path(GetCachedImage(url, details, true)); + std::string path(GetCachedImage(url, details, true)); needsRecaching = !details.hash.empty(); if (!path.empty()) { if (!needsRecaching && returnDDS && !URIUtils::IsInPath(url, "special://skin/")) // TODO: should skin images be .dds'd (currently they're not necessarily writeable) { // check for dds version - CStdString ddsPath = URIUtils::ReplaceExtension(path, ".dds"); + std::string ddsPath = URIUtils::ReplaceExtension(path, ".dds"); if (CFile::Exists(ddsPath)) return ddsPath; if (g_advancedSettings.m_useDDSFanart) @@ -122,10 +122,10 @@ CStdString CTextureCache::CheckCachedImage(const CStdString &url, bool returnDDS return ""; } -void CTextureCache::BackgroundCacheImage(const CStdString &url) +void CTextureCache::BackgroundCacheImage(const std::string &url) { CTextureDetails details; - CStdString path(GetCachedImage(url, details)); + std::string path(GetCachedImage(url, details)); if (!path.empty() && details.hash.empty()) return; // image is already cached and doesn't need to be checked further @@ -133,18 +133,18 @@ void CTextureCache::BackgroundCacheImage(const CStdString &url) AddJob(new CTextureCacheJob(CTextureUtils::UnwrapImageURL(url), details.hash)); } -bool CTextureCache::CacheImage(const CStdString &image, CTextureDetails &details) +bool CTextureCache::CacheImage(const std::string &image, CTextureDetails &details) { - CStdString path = GetCachedImage(image, details); + std::string path = GetCachedImage(image, details); if (path.empty()) // not cached path = CacheImage(image, NULL, &details); return !path.empty(); } -CStdString CTextureCache::CacheImage(const CStdString &image, CBaseTexture **texture, CTextureDetails *details) +std::string CTextureCache::CacheImage(const std::string &image, CBaseTexture **texture, CTextureDetails *details) { - CStdString url = CTextureUtils::UnwrapImageURL(image); + std::string url = CTextureUtils::UnwrapImageURL(image); CSingleLock lock(m_processingSection); if (m_processinglist.find(url) == m_processinglist.end()) { @@ -176,11 +176,11 @@ CStdString CTextureCache::CacheImage(const CStdString &image, CBaseTexture **tex return GetCachedImage(url, *details, true); } -void CTextureCache::ClearCachedImage(const CStdString &url, bool deleteSource /*= false */) +void CTextureCache::ClearCachedImage(const std::string &url, bool deleteSource /*= false */) { // TODO: This can be removed when the texture cache covers everything. - CStdString path = deleteSource ? url : ""; - CStdString cachedFile; + std::string path = deleteSource ? url : ""; + std::string cachedFile; if (ClearCachedTexture(url, cachedFile)) path = GetCachedPath(cachedFile); if (CFile::Exists(path)) @@ -192,7 +192,7 @@ void CTextureCache::ClearCachedImage(const CStdString &url, bool deleteSource /* bool CTextureCache::ClearCachedImage(int id) { - CStdString cachedFile; + std::string cachedFile; if (ClearCachedTexture(id, cachedFile)) { cachedFile = GetCachedPath(cachedFile); @@ -206,13 +206,13 @@ bool CTextureCache::ClearCachedImage(int id) return false; } -bool CTextureCache::GetCachedTexture(const CStdString &url, CTextureDetails &details) +bool CTextureCache::GetCachedTexture(const std::string &url, CTextureDetails &details) { CSingleLock lock(m_databaseSection); return m_database.GetCachedTexture(url, details); } -bool CTextureCache::AddCachedTexture(const CStdString &url, const CTextureDetails &details) +bool CTextureCache::AddCachedTexture(const std::string &url, const CTextureDetails &details) { CSingleLock lock(m_databaseSection); return m_database.AddCachedTexture(url, details); @@ -231,34 +231,34 @@ void CTextureCache::IncrementUseCount(const CTextureDetails &details) } } -bool CTextureCache::SetCachedTextureValid(const CStdString &url, bool updateable) +bool CTextureCache::SetCachedTextureValid(const std::string &url, bool updateable) { CSingleLock lock(m_databaseSection); return m_database.SetCachedTextureValid(url, updateable); } -bool CTextureCache::ClearCachedTexture(const CStdString &url, CStdString &cachedURL) +bool CTextureCache::ClearCachedTexture(const std::string &url, std::string &cachedURL) { CSingleLock lock(m_databaseSection); return m_database.ClearCachedTexture(url, cachedURL); } -bool CTextureCache::ClearCachedTexture(int id, CStdString &cachedURL) +bool CTextureCache::ClearCachedTexture(int id, std::string &cachedURL) { CSingleLock lock(m_databaseSection); return m_database.ClearCachedTexture(id, cachedURL); } -CStdString CTextureCache::GetCacheFile(const CStdString &url) +std::string CTextureCache::GetCacheFile(const std::string &url) { Crc32 crc; crc.ComputeFromLowerCase(url); - CStdString hex = StringUtils::Format("%08x", (unsigned int)crc); - CStdString hash = StringUtils::Format("%c/%s", hex[0], hex.c_str()); + std::string hex = StringUtils::Format("%08x", (unsigned int)crc); + std::string hash = StringUtils::Format("%c/%s", hex[0], hex.c_str()); return hash; } -CStdString CTextureCache::GetCachedPath(const CStdString &file) +std::string CTextureCache::GetCachedPath(const std::string &file) { return URIUtils::AddFileToFolder(CProfilesManager::Get().GetThumbnailsFolder(), file); } @@ -275,7 +275,7 @@ void CTextureCache::OnCachingComplete(bool success, CTextureCacheJob *job) { // remove from our processing list CSingleLock lock(m_processingSection); - std::set::iterator i = m_processinglist.find(job->m_url); + std::set::iterator i = m_processinglist.find(job->m_url); if (i != m_processinglist.end()) m_processinglist.erase(i); } @@ -301,7 +301,7 @@ void CTextureCache::OnJobProgress(unsigned int jobID, unsigned int progress, uns { CSingleLock lock(m_processingSection); const CTextureCacheJob *cacheJob = (CTextureCacheJob *)job; - std::set::iterator i = m_processinglist.find(cacheJob->m_url); + std::set::iterator i = m_processinglist.find(cacheJob->m_url); if (i == m_processinglist.end()) { m_processinglist.insert(cacheJob->m_url); @@ -314,13 +314,13 @@ void CTextureCache::OnJobProgress(unsigned int jobID, unsigned int progress, uns CJobQueue::OnJobProgress(jobID, progress, total, job); } -bool CTextureCache::Export(const CStdString &image, const CStdString &destination, bool overwrite) +bool CTextureCache::Export(const std::string &image, const std::string &destination, bool overwrite) { CTextureDetails details; - CStdString cachedImage(GetCachedImage(image, details)); + std::string cachedImage(GetCachedImage(image, details)); if (!cachedImage.empty()) { - CStdString dest = destination + CStdString(URIUtils::GetExtension(cachedImage)); + std::string dest = destination + URIUtils::GetExtension(cachedImage); if (overwrite || !CFile::Exists(dest)) { if (CFile::Copy(cachedImage, dest)) @@ -331,10 +331,10 @@ bool CTextureCache::Export(const CStdString &image, const CStdString &destinatio return false; } -bool CTextureCache::Export(const CStdString &image, const CStdString &destination) +bool CTextureCache::Export(const std::string &image, const std::string &destination) { CTextureDetails details; - CStdString cachedImage(GetCachedImage(image, details)); + std::string cachedImage(GetCachedImage(image, details)); if (!cachedImage.empty()) { if (CFile::Copy(cachedImage, destination)) diff --git a/xbmc/TextureCache.h b/xbmc/TextureCache.h index af2e2c8cc1292..f35c56c7c9371 100644 --- a/xbmc/TextureCache.h +++ b/xbmc/TextureCache.h @@ -21,7 +21,8 @@ #pragma once #include -#include "utils/StdString.h" +#include +#include #include "utils/JobManager.h" #include "TextureDatabase.h" #include "threads/Event.h" @@ -68,7 +69,7 @@ class CTextureCache : public CJobQueue \return cached url of this image \sa GetCachedImage */ - CStdString CheckCachedImage(const CStdString &image, bool returnDDS, bool &needsRecaching); + std::string CheckCachedImage(const std::string &image, bool returnDDS, bool &needsRecaching); /*! \brief Cache image (if required) using a background job @@ -79,7 +80,7 @@ class CTextureCache : public CJobQueue \param image url of the image to cache \sa CacheImage */ - void BackgroundCacheImage(const CStdString &image); + void BackgroundCacheImage(const std::string &image); /*! \brief Cache an image to image cache, optionally return the texture @@ -91,7 +92,7 @@ class CTextureCache : public CJobQueue \return cached url of this image \sa CTextureCacheJob::CacheTexture */ - CStdString CacheImage(const CStdString &url, CBaseTexture **texture = NULL, CTextureDetails *details = NULL); + std::string CacheImage(const std::string &url, CBaseTexture **texture = NULL, CTextureDetails *details = NULL); /*! \brief Cache an image to image cache if not already cached, returning the image details. \param image url of the image to cache. @@ -99,7 +100,7 @@ class CTextureCache : public CJobQueue \return true if the image is in the cache, false otherwise. \sa CTextureCacheJob::CacheTexture */ - bool CacheImage(const CStdString &image, CTextureDetails &details); + bool CacheImage(const std::string &image, CTextureDetails &details); /*! \brief Check whether an image is in the cache Note: If the image url won't normally be cached (eg a skin image) this function will return false. @@ -107,13 +108,13 @@ class CTextureCache : public CJobQueue \return true if the image is cached, false otherwise \sa ClearCachedImage */ - bool HasCachedImage(const CStdString &image); + bool HasCachedImage(const std::string &image); /*! \brief clear the cached version of the given image \param image url of the image \sa GetCachedImage */ - void ClearCachedImage(const CStdString &image, bool deleteSource = false); + void ClearCachedImage(const std::string &image, bool deleteSource = false); /*! \brief clear the cached version of the image with given id \param database id of the image @@ -126,13 +127,13 @@ class CTextureCache : public CJobQueue \param url location of the image \return a "unique" filename for the associated cache file, excluding extension */ - static CStdString GetCacheFile(const CStdString &url); + static std::string GetCacheFile(const std::string &url); /*! \brief retrieve the full path of the given cached file \param file name of the file \return full path of the cached file */ - static CStdString GetCachedPath(const CStdString &file); + static std::string GetCachedPath(const std::string &file); /*! \brief check whether an image:// URL may be cached \param url the URL to the image @@ -146,7 +147,7 @@ class CTextureCache : public CJobQueue \param details the texture details to add \return true if we successfully added to the database, false otherwise. */ - bool AddCachedTexture(const CStdString &image, const CTextureDetails &details); + bool AddCachedTexture(const std::string &image, const CTextureDetails &details); /*! \brief Export a (possibly) cached image to a file \param image url of the original image @@ -154,8 +155,8 @@ class CTextureCache : public CJobQueue \param overwrite whether to overwrite the destination if it exists (TODO: Defaults to false) \return true if we successfully exported the file, false otherwise. */ - bool Export(const CStdString &image, const CStdString &destination, bool overwrite); - bool Export(const CStdString &image, const CStdString &destination); // TODO: BACKWARD COMPATIBILITY FOR MUSIC THUMBS + bool Export(const std::string &image, const std::string &destination, bool overwrite); + bool Export(const std::string &image, const std::string &destination); // TODO: BACKWARD COMPATIBILITY FOR MUSIC THUMBS private: // private construction, and no assignements; use the provided singleton methods CTextureCache(); @@ -167,7 +168,7 @@ class CTextureCache : public CJobQueue \param image url of the image \return true if this is a cached image, false otherwise. */ - bool IsCachedImage(const CStdString &image) const; + bool IsCachedImage(const std::string &image) const; /*! \brief retrieve the cached version of the given image (if it exists) \param image url of the image @@ -176,7 +177,7 @@ class CTextureCache : public CJobQueue \return cached url of this image, empty if none exists \sa ClearCachedImage, CTextureDetails */ - CStdString GetCachedImage(const CStdString &image, CTextureDetails &details, bool trackUsage = false); + std::string GetCachedImage(const std::string &image, CTextureDetails &details, bool trackUsage = false); /*! \brief Get an image from the database Thread-safe wrapper of CTextureDatabase::GetCachedTexture @@ -184,7 +185,7 @@ class CTextureCache : public CJobQueue \param details [out] texture details from the database (if available) \return true if we have a cached version of this image, false otherwise. */ - bool GetCachedTexture(const CStdString &url, CTextureDetails &details); + bool GetCachedTexture(const std::string &url, CTextureDetails &details); /*! \brief Clear an image from the database Thread-safe wrapper of CTextureDatabase::ClearCachedTexture @@ -192,8 +193,8 @@ class CTextureCache : public CJobQueue \param cacheFile [out] url of the cached original (if available) \return true if we had a cached version of this image, false otherwise. */ - bool ClearCachedTexture(const CStdString &url, CStdString &cacheFile); - bool ClearCachedTexture(int textureID, CStdString &cacheFile); + bool ClearCachedTexture(const std::string &url, std::string &cacheFile); + bool ClearCachedTexture(int textureID, std::string &cacheFile); /*! \brief Increment the use count of a texture Stores locally before calling CTextureDatabase::IncrementUseCount via a CUseCountJob @@ -207,7 +208,7 @@ class CTextureCache : public CJobQueue \param updateable whether this image should be checked for updates \return true if successful, false otherwise. */ - bool SetCachedTextureValid(const CStdString &url, bool updateable); + bool SetCachedTextureValid(const std::string &url, bool updateable); virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job); virtual void OnJobProgress(unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job); @@ -222,7 +223,7 @@ class CTextureCache : public CJobQueue CCriticalSection m_databaseSection; CTextureDatabase m_database; - std::set m_processinglist; ///< currently processing list to avoid 2 jobs being processed at once + std::set m_processinglist; ///< currently processing list to avoid 2 jobs being processed at once CCriticalSection m_processingSection; CEvent m_completeEvent; ///< Set whenever a job has finished std::vector m_useCounts; ///< Use count tracking diff --git a/xbmc/TextureCacheJob.cpp b/xbmc/TextureCacheJob.cpp index fe0904d6738aa..a21614d29ccfb 100644 --- a/xbmc/TextureCacheJob.cpp +++ b/xbmc/TextureCacheJob.cpp @@ -37,7 +37,7 @@ #include "cores/omxplayer/OMXImage.h" #endif -CTextureCacheJob::CTextureCacheJob(const CStdString &url, const CStdString &oldHash) +CTextureCacheJob::CTextureCacheJob(const std::string &url, const std::string &oldHash) { m_url = url; m_oldHash = oldHash; @@ -68,7 +68,7 @@ bool CTextureCacheJob::DoWork() // check whether we need cache the job anyway bool needsRecaching = false; - CStdString path(CTextureCache::Get().CheckCachedImage(m_url, false, needsRecaching)); + std::string path(CTextureCache::Get().CheckCachedImage(m_url, false, needsRecaching)); if (!path.empty() && !needsRecaching) return false; return CacheTexture(); @@ -79,7 +79,7 @@ bool CTextureCacheJob::CacheTexture(CBaseTexture **out_texture) // unwrap the URL as required std::string additional_info; unsigned int width, height; - CStdString image = DecodeImageURL(m_url, width, height, additional_info); + std::string image = DecodeImageURL(m_url, width, height, additional_info); m_details.updateable = additional_info != "music" && UpdateableURL(image); @@ -127,10 +127,10 @@ bool CTextureCacheJob::CacheTexture(CBaseTexture **out_texture) return false; } -CStdString CTextureCacheJob::DecodeImageURL(const CStdString &url, unsigned int &width, unsigned int &height, std::string &additional_info) +std::string CTextureCacheJob::DecodeImageURL(const std::string &url, unsigned int &width, unsigned int &height, std::string &additional_info) { // unwrap the URL as required - CStdString image(url); + std::string image(url); additional_info.clear(); width = height = 0; if (StringUtils::StartsWith(url, "image://")) @@ -154,7 +154,7 @@ CStdString CTextureCacheJob::DecodeImageURL(const CStdString &url, unsigned int return image; } -CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int width, unsigned int height, const std::string &additional_info, bool requirePixels) +CBaseTexture *CTextureCacheJob::LoadImage(const std::string &image, unsigned int width, unsigned int height, const std::string &additional_info, bool requirePixels) { if (additional_info == "music") { // special case for embedded music images @@ -183,7 +183,7 @@ CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int return texture; } -bool CTextureCacheJob::UpdateableURL(const CStdString &url) const +bool CTextureCacheJob::UpdateableURL(const std::string &url) const { // we don't constantly check online images if (StringUtils::StartsWith(url, "http://") || @@ -192,7 +192,7 @@ bool CTextureCacheJob::UpdateableURL(const CStdString &url) const return true; } -CStdString CTextureCacheJob::GetImageHash(const CStdString &url) +std::string CTextureCacheJob::GetImageHash(const std::string &url) { struct __stat64 st; if (XFILE::CFile::Stat(url, &st) == 0) @@ -208,7 +208,7 @@ CStdString CTextureCacheJob::GetImageHash(const CStdString &url) return ""; } -CTextureDDSJob::CTextureDDSJob(const CStdString &original) +CTextureDDSJob::CTextureDDSJob(const std::string &original) { m_original = original; } diff --git a/xbmc/TextureCacheJob.h b/xbmc/TextureCacheJob.h index 73f575641205a..0515db9a65f4c 100644 --- a/xbmc/TextureCacheJob.h +++ b/xbmc/TextureCacheJob.h @@ -20,7 +20,8 @@ #pragma once -#include "utils/StdString.h" +#include +#include #include "utils/Job.h" class CBaseTexture; @@ -61,7 +62,7 @@ class CTextureDetails class CTextureCacheJob : public CJob { public: - CTextureCacheJob(const CStdString &url, const CStdString &oldHash = ""); + CTextureCacheJob(const std::string &url, const std::string &oldHash = ""); virtual ~CTextureCacheJob(); virtual const char* GetType() const { return kJobTypeCacheImage; }; @@ -75,8 +76,8 @@ class CTextureCacheJob : public CJob */ bool CacheTexture(CBaseTexture **texture = NULL); - CStdString m_url; - CStdString m_oldHash; + std::string m_url; + std::string m_oldHash; CTextureDetails m_details; private: friend class CEdenVideoArtUpdater; @@ -86,7 +87,7 @@ class CTextureCacheJob : public CJob \param url location of the image \return a hash string for this image */ - static CStdString GetImageHash(const CStdString &url); + static std::string GetImageHash(const std::string &url); /*! \brief Check whether a given URL represents an image that can be updated We currently don't check http:// and https:// URLs for updates, under the assumption that @@ -95,7 +96,7 @@ class CTextureCacheJob : public CJob \param url the url to check \return true if the image given by the URL should be checked for updates, false otehrwise */ - bool UpdateableURL(const CStdString &url) const; + bool UpdateableURL(const std::string &url) const; /*! \brief Decode an image URL to the underlying image, width, height and orientation \param url wrapped URL of the image @@ -104,7 +105,7 @@ class CTextureCacheJob : public CJob \param additional_info additional information, such as "flipped" to flip horizontally \return URL of the underlying image file. */ - static CStdString DecodeImageURL(const CStdString &url, unsigned int &width, unsigned int &height, std::string &additional_info); + static std::string DecodeImageURL(const std::string &url, unsigned int &width, unsigned int &height, std::string &additional_info); /*! \brief Load an image at a given target size and orientation. @@ -117,9 +118,9 @@ class CTextureCacheJob : public CJob \param additional_info extra info for loading, such as whether to flip horizontally. \return a pointer to a CBaseTexture object, NULL if failed. */ - static CBaseTexture *LoadImage(const CStdString &image, unsigned int width, unsigned int height, const std::string &additional_info, bool requirePixels = false); + static CBaseTexture *LoadImage(const std::string &image, unsigned int width, unsigned int height, const std::string &additional_info, bool requirePixels = false); - CStdString m_cachePath; + std::string m_cachePath; }; /* \brief Job class for creating .dds versions of textures @@ -127,13 +128,13 @@ class CTextureCacheJob : public CJob class CTextureDDSJob : public CJob { public: - CTextureDDSJob(const CStdString &original); + CTextureDDSJob(const std::string &original); virtual const char* GetType() const { return kJobTypeDDSCompress; }; virtual bool operator==(const CJob *job) const; virtual bool DoWork(); - CStdString m_original; + std::string m_original; }; /* \brief Job class for storing the use count of textures diff --git a/xbmc/TextureDatabase.cpp b/xbmc/TextureDatabase.cpp index 2af5ec8fc1d0b..0e5b6df82734d 100644 --- a/xbmc/TextureDatabase.cpp +++ b/xbmc/TextureDatabase.cpp @@ -118,7 +118,7 @@ void CTextureRule::GetAvailableFields(std::vector &fieldList) fieldList.push_back(fields[i].string); } -CStdString CTextureUtils::GetWrappedImageURL(const CStdString &image, const CStdString &type, const CStdString &options) +std::string CTextureUtils::GetWrappedImageURL(const std::string &image, const std::string &type, const std::string &options) { if (StringUtils::StartsWith(image, "image://")) return image; // already wrapped @@ -135,12 +135,12 @@ CStdString CTextureUtils::GetWrappedImageURL(const CStdString &image, const CStd return url.Get(); } -CStdString CTextureUtils::GetWrappedThumbURL(const CStdString &image) +std::string CTextureUtils::GetWrappedThumbURL(const std::string &image) { return GetWrappedImageURL(image, "", "size=thumb"); } -CStdString CTextureUtils::UnwrapImageURL(const CStdString &image) +std::string CTextureUtils::UnwrapImageURL(const std::string &image) { if (StringUtils::StartsWith(image, "image://")) { @@ -246,18 +246,18 @@ void CTextureDatabase::UpdateTables(int version) bool CTextureDatabase::IncrementUseCount(const CTextureDetails &details) { - CStdString sql = PrepareSQL("UPDATE sizes SET usecount=usecount+1, lastusetime=CURRENT_TIMESTAMP WHERE idtexture=%u AND width=%u AND height=%u", details.id, details.width, details.height); + std::string sql = PrepareSQL("UPDATE sizes SET usecount=usecount+1, lastusetime=CURRENT_TIMESTAMP WHERE idtexture=%u AND width=%u AND height=%u", details.id, details.width, details.height); return ExecuteQuery(sql); } -bool CTextureDatabase::GetCachedTexture(const CStdString &url, CTextureDetails &details) +bool CTextureDatabase::GetCachedTexture(const std::string &url, CTextureDetails &details) { try { if (NULL == m_pDB.get()) return false; if (NULL == m_pDS.get()) return false; - CStdString sql = PrepareSQL("SELECT id, cachedurl, lasthashcheck, imagehash, width, height FROM texture JOIN sizes ON (texture.id=sizes.idtexture AND sizes.size=1) WHERE url='%s'", url.c_str()); + std::string sql = PrepareSQL("SELECT id, cachedurl, lasthashcheck, imagehash, width, height FROM texture JOIN sizes ON (texture.id=sizes.idtexture AND sizes.size=1) WHERE url='%s'", url.c_str()); m_pDS->query(sql.c_str()); if (!m_pDS->eof()) { // have some information @@ -327,24 +327,24 @@ bool CTextureDatabase::GetTextures(CVariant &items, const Filter &filter) return false; } -bool CTextureDatabase::SetCachedTextureValid(const CStdString &url, bool updateable) +bool CTextureDatabase::SetCachedTextureValid(const std::string &url, bool updateable) { - CStdString date = updateable ? CDateTime::GetCurrentDateTime().GetAsDBDateTime() : ""; - CStdString sql = PrepareSQL("UPDATE texture SET lasthashcheck='%s' WHERE url='%s'", date.c_str(), url.c_str()); + std::string date = updateable ? CDateTime::GetCurrentDateTime().GetAsDBDateTime() : ""; + std::string sql = PrepareSQL("UPDATE texture SET lasthashcheck='%s' WHERE url='%s'", date.c_str(), url.c_str()); return ExecuteQuery(sql); } -bool CTextureDatabase::AddCachedTexture(const CStdString &url, const CTextureDetails &details) +bool CTextureDatabase::AddCachedTexture(const std::string &url, const CTextureDetails &details) { try { if (NULL == m_pDB.get()) return false; if (NULL == m_pDS.get()) return false; - CStdString sql = PrepareSQL("DELETE FROM texture WHERE url='%s'", url.c_str()); + std::string sql = PrepareSQL("DELETE FROM texture WHERE url='%s'", url.c_str()); m_pDS->exec(sql.c_str()); - CStdString date = details.updateable ? CDateTime::GetCurrentDateTime().GetAsDBDateTime() : ""; + std::string date = details.updateable ? CDateTime::GetCurrentDateTime().GetAsDBDateTime() : ""; sql = PrepareSQL("INSERT INTO texture (id, url, cachedurl, imagehash, lasthashcheck) VALUES(NULL, '%s', '%s', '%s', '%s')", url.c_str(), details.file.c_str(), details.hash.c_str(), date.c_str()); m_pDS->exec(sql.c_str()); int textureID = (int)m_pDS->lastinsertid(); @@ -360,20 +360,20 @@ bool CTextureDatabase::AddCachedTexture(const CStdString &url, const CTextureDet return true; } -bool CTextureDatabase::ClearCachedTexture(const CStdString &url, CStdString &cacheFile) +bool CTextureDatabase::ClearCachedTexture(const std::string &url, std::string &cacheFile) { std::string id = GetSingleValue(PrepareSQL("select id from texture where url='%s'", url.c_str())); return !id.empty() ? ClearCachedTexture(strtol(id.c_str(), NULL, 10), cacheFile) : false; } -bool CTextureDatabase::ClearCachedTexture(int id, CStdString &cacheFile) +bool CTextureDatabase::ClearCachedTexture(int id, std::string &cacheFile) { try { if (NULL == m_pDB.get()) return false; if (NULL == m_pDS.get()) return false; - CStdString sql = PrepareSQL("select cachedurl from texture where id=%u", id); + std::string sql = PrepareSQL("select cachedurl from texture where id=%u", id); m_pDS->query(sql.c_str()); if (!m_pDS->eof()) @@ -394,14 +394,14 @@ bool CTextureDatabase::ClearCachedTexture(int id, CStdString &cacheFile) return false; } -bool CTextureDatabase::InvalidateCachedTexture(const CStdString &url) +bool CTextureDatabase::InvalidateCachedTexture(const std::string &url) { - CStdString date = (CDateTime::GetCurrentDateTime() - CDateTimeSpan(2, 0, 0, 0)).GetAsDBDateTime(); - CStdString sql = PrepareSQL("UPDATE texture SET lasthashcheck='%s' WHERE url='%s'", date.c_str(), url.c_str()); + std::string date = (CDateTime::GetCurrentDateTime() - CDateTimeSpan(2, 0, 0, 0)).GetAsDBDateTime(); + std::string sql = PrepareSQL("UPDATE texture SET lasthashcheck='%s' WHERE url='%s'", date.c_str(), url.c_str()); return ExecuteQuery(sql); } -CStdString CTextureDatabase::GetTextureForPath(const CStdString &url, const CStdString &type) +std::string CTextureDatabase::GetTextureForPath(const std::string &url, const std::string &type) { try { @@ -411,12 +411,12 @@ CStdString CTextureDatabase::GetTextureForPath(const CStdString &url, const CStd if (url.empty()) return ""; - CStdString sql = PrepareSQL("select texture from path where url='%s' and type='%s'", url.c_str(), type.c_str()); + std::string sql = PrepareSQL("select texture from path where url='%s' and type='%s'", url.c_str(), type.c_str()); m_pDS->query(sql.c_str()); if (!m_pDS->eof()) { // have some information - CStdString texture = m_pDS->fv(0).get_asString(); + std::string texture = m_pDS->fv(0).get_asString(); m_pDS->close(); return texture; } @@ -429,7 +429,7 @@ CStdString CTextureDatabase::GetTextureForPath(const CStdString &url, const CStd return ""; } -void CTextureDatabase::SetTextureForPath(const CStdString &url, const CStdString &type, const CStdString &texture) +void CTextureDatabase::SetTextureForPath(const std::string &url, const std::string &type, const std::string &texture) { try { @@ -439,7 +439,7 @@ void CTextureDatabase::SetTextureForPath(const CStdString &url, const CStdString if (url.empty()) return; - CStdString sql = PrepareSQL("select id from path where url='%s' and type='%s'", url.c_str(), type.c_str()); + std::string sql = PrepareSQL("select id from path where url='%s' and type='%s'", url.c_str(), type.c_str()); m_pDS->query(sql.c_str()); if (!m_pDS->eof()) { // update @@ -462,14 +462,14 @@ void CTextureDatabase::SetTextureForPath(const CStdString &url, const CStdString return; } -void CTextureDatabase::ClearTextureForPath(const CStdString &url, const CStdString &type) +void CTextureDatabase::ClearTextureForPath(const std::string &url, const std::string &type) { try { if (NULL == m_pDB.get()) return; if (NULL == m_pDS.get()) return; - CStdString sql = PrepareSQL("DELETE FROM path WHERE url='%s' and type='%s'", url.c_str(), type.c_str()); + std::string sql = PrepareSQL("DELETE FROM path WHERE url='%s' and type='%s'", url.c_str(), type.c_str()); m_pDS->exec(sql.c_str()); } catch (...) diff --git a/xbmc/TextureDatabase.h b/xbmc/TextureDatabase.h index 0bb84022efc2a..35716d253ab03 100644 --- a/xbmc/TextureDatabase.h +++ b/xbmc/TextureDatabase.h @@ -54,15 +54,15 @@ class CTextureUtils \param options which options we need (eg size=thumb) \return full wrapped URL of the image file */ - static CStdString GetWrappedImageURL(const CStdString &image, const CStdString &type = "", const CStdString &options = ""); - static CStdString GetWrappedThumbURL(const CStdString &image); + static std::string GetWrappedImageURL(const std::string &image, const std::string &type = "", const std::string &options = ""); + static std::string GetWrappedThumbURL(const std::string &image); /*! \brief Unwrap an image:// style URL Such urls are used for art over the webserver or other users of the VFS \param image url of the image \return the unwrapped URL, or the original URL if unwrapping is inappropriate. */ - static CStdString UnwrapImageURL(const CStdString &image); + static std::string UnwrapImageURL(const std::string &image); }; class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory @@ -72,11 +72,11 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory virtual ~CTextureDatabase(); virtual bool Open(); - bool GetCachedTexture(const CStdString &originalURL, CTextureDetails &details); - bool AddCachedTexture(const CStdString &originalURL, const CTextureDetails &details); - bool SetCachedTextureValid(const CStdString &originalURL, bool updateable); - bool ClearCachedTexture(const CStdString &originalURL, CStdString &cacheFile); - bool ClearCachedTexture(int textureID, CStdString &cacheFile); + bool GetCachedTexture(const std::string &originalURL, CTextureDetails &details); + bool AddCachedTexture(const std::string &originalURL, const CTextureDetails &details); + bool SetCachedTextureValid(const std::string &originalURL, bool updateable); + bool ClearCachedTexture(const std::string &originalURL, std::string &cacheFile); + bool ClearCachedTexture(int textureID, std::string &cacheFile); bool IncrementUseCount(const CTextureDetails &details); /*! \brief Invalidate a previously cached texture @@ -84,7 +84,7 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory next texture load it will be re-cached. \param url texture path */ - bool InvalidateCachedTexture(const CStdString &originalURL); + bool InvalidateCachedTexture(const std::string &originalURL); /*! \brief Get a texture associated with the given path Used for retrieval of previously discovered images to save @@ -93,7 +93,7 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory \param type type of image to look for \return URL of the texture associated with the given path */ - CStdString GetTextureForPath(const CStdString &url, const CStdString &type); + std::string GetTextureForPath(const std::string &url, const std::string &type); /*! \brief Set a texture associated with the given path Used for setting of previously discovered images to save @@ -104,7 +104,7 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory \param type type of image to associate \param texture URL of the texture to associate with the path */ - void SetTextureForPath(const CStdString &url, const CStdString &type, const CStdString &texture); + void SetTextureForPath(const std::string &url, const std::string &type, const std::string &texture); /*! \brief Clear a texture associated with the given path \param url path that was used to find the texture @@ -112,7 +112,7 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory \param texture URL of the texture to associate with the path \sa GetTextureForPath, SetTextureForPath */ - void ClearTextureForPath(const CStdString &url, const CStdString &type); + void ClearTextureForPath(const std::string &url, const std::string &type); bool GetTextures(CVariant &items, const Filter &filter); @@ -125,7 +125,7 @@ class CTextureDatabase : public CDatabase, public IDatabaseQueryRuleFactory \param url url to hash \return a hash for this url */ - unsigned int GetURLHash(const CStdString &url) const; + unsigned int GetURLHash(const std::string &url) const; virtual void CreateTables(); virtual void CreateAnalytics(); diff --git a/xbmc/ThumbLoader.cpp b/xbmc/ThumbLoader.cpp index 4aa7b2c0ef682..9855e198c9acd 100644 --- a/xbmc/ThumbLoader.cpp +++ b/xbmc/ThumbLoader.cpp @@ -47,18 +47,18 @@ void CThumbLoader::OnLoaderFinish() m_textureDatabase->Close(); } -CStdString CThumbLoader::GetCachedImage(const CFileItem &item, const CStdString &type) +std::string CThumbLoader::GetCachedImage(const CFileItem &item, const std::string &type) { if (!item.GetPath().empty() && m_textureDatabase->Open()) { - CStdString image = m_textureDatabase->GetTextureForPath(item.GetPath(), type); + std::string image = m_textureDatabase->GetTextureForPath(item.GetPath(), type); m_textureDatabase->Close(); return image; } return ""; } -void CThumbLoader::SetCachedImage(const CFileItem &item, const CStdString &type, const CStdString &image) +void CThumbLoader::SetCachedImage(const CFileItem &item, const std::string &type, const std::string &image) { if (!item.GetPath().empty() && m_textureDatabase->Open()) { @@ -99,7 +99,7 @@ bool CProgramThumbLoader::LoadItemLookup(CFileItem *pItem) bool CProgramThumbLoader::FillThumb(CFileItem &item) { // no need to do anything if we already have a thumb set - CStdString thumb = item.GetArt("thumb"); + std::string thumb = item.GetArt("thumb"); if (thumb.empty()) { // see whether we have a cached image for this item @@ -120,7 +120,7 @@ bool CProgramThumbLoader::FillThumb(CFileItem &item) return true; } -CStdString CProgramThumbLoader::GetLocalThumb(const CFileItem &item) +std::string CProgramThumbLoader::GetLocalThumb(const CFileItem &item) { if (item.IsAddonsPath()) return ""; @@ -128,13 +128,13 @@ CStdString CProgramThumbLoader::GetLocalThumb(const CFileItem &item) // look for the thumb if (item.m_bIsFolder) { - CStdString folderThumb = item.GetFolderThumb(); + std::string folderThumb = item.GetFolderThumb(); if (CFile::Exists(folderThumb)) return folderThumb; } else { - CStdString fileThumb(item.GetTBNFile()); + std::string fileThumb(item.GetTBNFile()); if (CFile::Exists(fileThumb)) return fileThumb; } diff --git a/xbmc/ThumbLoader.h b/xbmc/ThumbLoader.h index a5ee38bcba058..bc497a43eb9f6 100644 --- a/xbmc/ThumbLoader.h +++ b/xbmc/ThumbLoader.h @@ -20,7 +20,7 @@ */ #include "BackgroundInfoLoader.h" -#include "utils/StdString.h" +#include class CTextureDatabase; @@ -44,14 +44,14 @@ class CThumbLoader : public CBackgroundInfoLoader \param type the type of image to retrieve \return the image associated with this item */ - virtual CStdString GetCachedImage(const CFileItem &item, const CStdString &type); + virtual std::string GetCachedImage(const CFileItem &item, const std::string &type); /*! \brief Associate an image with the given item in the texture database \param item CFileItem to associate the image with \param type the type of image \param image the URL of the image */ - virtual void SetCachedImage(const CFileItem &item, const CStdString &type, const CStdString &image); + virtual void SetCachedImage(const CFileItem &item, const std::string &type, const std::string &image); protected: CTextureDatabase *m_textureDatabase; @@ -81,5 +81,5 @@ class CProgramThumbLoader : public CThumbLoader \return the local thumb (if it exists) \sa FillThumb */ - static CStdString GetLocalThumb(const CFileItem &item); + static std::string GetLocalThumb(const CFileItem &item); }; diff --git a/xbmc/filesystem/DAVFile.cpp b/xbmc/filesystem/DAVFile.cpp index 4e89a9e652b2d..9713c59e8e4a4 100644 --- a/xbmc/filesystem/DAVFile.cpp +++ b/xbmc/filesystem/DAVFile.cpp @@ -49,7 +49,7 @@ bool CDAVFile::Execute(const CURL& url) CLog::Log(LOGDEBUG, "CDAVFile::Execute(%p) %s", (void*)this, m_url.c_str()); - ASSERT(!(!m_state->m_easyHandle ^ !m_state->m_multiHandle)); + assert(!(!m_state->m_easyHandle ^ !m_state->m_multiHandle)); if( m_state->m_easyHandle == NULL ) g_curlInterface.easy_aquire(url2.GetProtocol().c_str(), url2.GetHostName().c_str(), diff --git a/xbmc/filesystem/DllLibCurl.h b/xbmc/filesystem/DllLibCurl.h index 304459f655f95..db97f923eab36 100644 --- a/xbmc/filesystem/DllLibCurl.h +++ b/xbmc/filesystem/DllLibCurl.h @@ -21,6 +21,8 @@ #include "DynamicDll.h" #include "threads/CriticalSection.h" +#include +#include /* put types of curl in namespace to avoid namespace pollution */ namespace XCURL diff --git a/xbmc/network/upnp/UPnP.cpp b/xbmc/network/upnp/UPnP.cpp index ec187e7c82f1c..52580577a100b 100644 --- a/xbmc/network/upnp/UPnP.cpp +++ b/xbmc/network/upnp/UPnP.cpp @@ -577,7 +577,7 @@ CUPnPServer* CUPnP::CreateServer(int port /* = 0 */) { CUPnPServer* device = - new CUPnPServer(g_infoManager.GetLabel(SYSTEM_FRIENDLY_NAME), + new CUPnPServer(g_infoManager.GetLabel(SYSTEM_FRIENDLY_NAME).c_str(), CUPnPSettings::Get().GetServerUUID().length() ? CUPnPSettings::Get().GetServerUUID().c_str() : NULL, port); @@ -661,7 +661,7 @@ CUPnPRenderer* CUPnP::CreateRenderer(int port /* = 0 */) { CUPnPRenderer* device = - new CUPnPRenderer(g_infoManager.GetLabel(SYSTEM_FRIENDLY_NAME), + new CUPnPRenderer(g_infoManager.GetLabel(SYSTEM_FRIENDLY_NAME).c_str(), false, (CUPnPSettings::Get().GetRendererUUID().length() ? CUPnPSettings::Get().GetRendererUUID().c_str() : NULL), port); diff --git a/xbmc/network/upnp/UPnPRenderer.cpp b/xbmc/network/upnp/UPnPRenderer.cpp index 39552bdc26820..cf6377d82e196 100644 --- a/xbmc/network/upnp/UPnPRenderer.cpp +++ b/xbmc/network/upnp/UPnPRenderer.cpp @@ -330,8 +330,8 @@ CUPnPRenderer::UpdateState() } else if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW) { avt->SetStateVariable("TransportState", "PLAYING"); - avt->SetStateVariable("AVTransportURI" , g_infoManager.GetPictureLabel(SLIDE_FILE_PATH)); - avt->SetStateVariable("CurrentTrackURI", g_infoManager.GetPictureLabel(SLIDE_FILE_PATH)); + avt->SetStateVariable("AVTransportURI" , g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str()); + avt->SetStateVariable("CurrentTrackURI", g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str()); avt->SetStateVariable("TransportPlaySpeed", "1"); CGUIWindowSlideShow *slideshow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW); diff --git a/xbmc/test/TestBasicEnvironment.cpp b/xbmc/test/TestBasicEnvironment.cpp index 0b158b28e1fce..239bfd47902dc 100644 --- a/xbmc/test/TestBasicEnvironment.cpp +++ b/xbmc/test/TestBasicEnvironment.cpp @@ -35,7 +35,7 @@ void TestBasicEnvironment::SetUp() { char *tmp; - CStdString xbmcTempPath; + std::string xbmcTempPath; XFILE::CFile *f; /* NOTE: The below is done to fix memleak warning about unitialized variable @@ -52,7 +52,7 @@ void TestBasicEnvironment::SetUp() //for darwin set framework path - else we get assert //in guisettings init below #ifdef TARGET_DARWIN - CStdString frameworksPath = CUtil::GetFrameworksPath(); + std::string frameworksPath = CUtil::GetFrameworksPath(); CSpecialProtocol::SetXBMCFrameworksPath(frameworksPath); #endif /* TODO: Something should be done about all the asserts in GUISettings so @@ -101,7 +101,7 @@ void TestBasicEnvironment::SetUp() void TestBasicEnvironment::TearDown() { - CStdString xbmcTempPath = CSpecialProtocol::TranslatePath("special://temp/"); + std::string xbmcTempPath = CSpecialProtocol::TranslatePath("special://temp/"); XFILE::CDirectory::Remove(xbmcTempPath); } diff --git a/xbmc/utils/EdenVideoArtUpdater.h b/xbmc/utils/EdenVideoArtUpdater.h index 312ff593b37c8..fb7b7e8930f91 100644 --- a/xbmc/utils/EdenVideoArtUpdater.h +++ b/xbmc/utils/EdenVideoArtUpdater.h @@ -22,6 +22,7 @@ #include #include "threads/Thread.h" #include "TextureDatabase.h" +#include "StdString.h" class CFileItem; diff --git a/xbmc/utils/FileOperationJob.h b/xbmc/utils/FileOperationJob.h index 908da10329a88..2de9a1be52edf 100644 --- a/xbmc/utils/FileOperationJob.h +++ b/xbmc/utils/FileOperationJob.h @@ -23,6 +23,7 @@ #include "FileItem.h" #include "Job.h" #include "filesystem/File.h" +#include "StdString.h" class CGUIDialogProgressBarHandle; diff --git a/xbmc/utils/FileUtils.h b/xbmc/utils/FileUtils.h index a73ab62401ec1..2c66d423ce1ee 100644 --- a/xbmc/utils/FileUtils.h +++ b/xbmc/utils/FileUtils.h @@ -20,6 +20,7 @@ */ #include #include "FileItem.h" +#include "StdString.h" class CFileUtils {