From 8999ff7af8d7d8e9f225c70a811407b729460557 Mon Sep 17 00:00:00 2001 From: "Chris \"Koying\" Browet" Date: Tue, 23 Dec 2014 12:34:41 +0100 Subject: [PATCH] [C++11] replace deprecated auto_ptr by unique_ptr --- xbmc/Application.cpp | 2 +- xbmc/Autorun.cpp | 2 +- xbmc/FileItem.cpp | 4 ++-- xbmc/addons/Visualisation.cpp | 4 ++-- xbmc/cdrip/CDDARipper.cpp | 2 +- .../dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp | 4 ++-- .../dvdplayer/DVDDemuxers/DVDDemuxVobsub.h | 4 ++-- .../DVDDemuxers/DVDFactoryDemuxer.cpp | 14 ++++++------- xbmc/cores/dvdplayer/DVDFileInfo.cpp | 4 ++-- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 +- xbmc/dbwrappers/Database.cpp | 2 +- xbmc/dbwrappers/Database.h | 8 ++++---- xbmc/filesystem/Directory.cpp | 8 ++++---- xbmc/filesystem/File.cpp | 20 +++++++++---------- xbmc/filesystem/MusicDatabaseDirectory.cpp | 14 ++++++------- .../MusicDatabaseDirectory/DirectoryNode.cpp | 4 ++-- xbmc/filesystem/PlaylistFileDirectory.cpp | 4 ++-- xbmc/filesystem/VideoDatabaseDirectory.cpp | 16 +++++++-------- .../VideoDatabaseDirectory/DirectoryNode.cpp | 6 +++--- xbmc/interfaces/Builtins.cpp | 2 +- xbmc/interfaces/legacy/PlayList.cpp | 2 +- xbmc/music/MusicInfoLoader.cpp | 4 ++-- xbmc/music/MusicThumbLoader.cpp | 2 +- xbmc/music/infoscanner/MusicInfoScanner.cpp | 2 +- xbmc/music/windows/GUIWindowMusicBase.cpp | 4 ++-- xbmc/music/windows/GUIWindowMusicNav.cpp | 2 +- xbmc/network/WebServer.cpp | 2 +- xbmc/pictures/GUIWindowPictures.cpp | 2 +- xbmc/playlists/PlayList.cpp | 2 +- xbmc/playlists/PlayListPLS.cpp | 2 +- xbmc/utils/AutoPtrHandle.h | 2 +- xbmc/utils/DatabaseUtils.cpp | 2 +- xbmc/utils/DatabaseUtils.h | 2 +- xbmc/utils/SortUtils.cpp | 2 +- xbmc/utils/SortUtils.h | 2 +- xbmc/utils/test/TestDatabaseUtils.cpp | 2 +- xbmc/video/VideoDatabase.cpp | 18 ++++++++--------- xbmc/video/VideoDatabase.h | 10 +++++----- xbmc/video/windows/GUIWindowVideoBase.cpp | 4 ++-- .../XBMCProjectM/libprojectM/IdlePreset.cpp | 4 ++-- .../XBMCProjectM/libprojectM/IdlePreset.hpp | 2 +- .../libprojectM/PresetChooser.hpp | 8 ++++---- .../XBMCProjectM/libprojectM/PresetLoader.cpp | 4 ++-- .../XBMCProjectM/libprojectM/PresetLoader.hpp | 2 +- .../XBMCProjectM/libprojectM/projectM.cpp | 2 +- .../XBMCProjectM/libprojectM/projectM.hpp | 6 +++--- .../XBMCProjectM/projectm_1.2.0.patch | 2 +- xbmc/windows/GUIMediaWindow.cpp | 6 +++--- xbmc/windows/GUIMediaWindow.h | 2 +- xbmc/windows/GUIWindowFileManager.cpp | 2 +- 50 files changed, 117 insertions(+), 117 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 3234480980f4c..ade1e2388a14d 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2983,7 +2983,7 @@ bool CApplication::PlayMedia(const CFileItem& item, int iPlaylist) CGUIDialogCache* dlgCache = new CGUIDialogCache(5000, g_localizeStrings.Get(10214), item.GetLabel()); //is or could be a playlist - auto_ptr pPlayList (CPlayListFactory::Create(item)); + unique_ptr pPlayList (CPlayListFactory::Create(item)); bool gotPlayList = (pPlayList.get() && pPlayList->Load(item.GetPath())); if (dlgCache) diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp index b79aabbfcc2b2..2a3c337a0d8d8 100644 --- a/xbmc/Autorun.cpp +++ b/xbmc/Autorun.cpp @@ -109,7 +109,7 @@ bool CAutorun::PlayDisc(const std::string& path, bool bypassSettings, bool start mediaPath = g_mediaManager.GetDiscPath(); const CURL pathToUrl(mediaPath); - auto_ptr pDir ( CDirectoryFactory::Create( pathToUrl )); + unique_ptr pDir ( CDirectoryFactory::Create( pathToUrl )); bool bPlaying = RunDisc(pDir.get(), mediaPath, nAddedToPlaylist, true, bypassSettings, startFromBeginning); if ( !bPlaying && nAddedToPlaylist > 0 ) diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index f8607cf145383..755cf467f8630 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -2171,7 +2171,7 @@ void CFileItemList::FilterCueItems() itemstodelete.push_back(strMediaFile); // get the additional stuff (year, genre etc.) from the underlying media files tag. CMusicInfoTag tag; - auto_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(strMediaFile)); + unique_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(strMediaFile)); if (NULL != pLoader.get()) { // get id3tag @@ -2997,7 +2997,7 @@ bool CFileItem::LoadMusicTag() // load tag from file CLog::Log(LOGDEBUG, "%s: loading tag information for file: %s", __FUNCTION__, m_strPath.c_str()); CMusicInfoTagLoaderFactory factory; - auto_ptr pLoader (factory.CreateLoader(m_strPath)); + unique_ptr pLoader (factory.CreateLoader(m_strPath)); if (NULL != pLoader.get()) { if (pLoader->Load(m_strPath, *GetMusicInfoTag())) diff --git a/xbmc/addons/Visualisation.cpp b/xbmc/addons/Visualisation.cpp index b28289bfaea08..a64ee597e53bc 100644 --- a/xbmc/addons/Visualisation.cpp +++ b/xbmc/addons/Visualisation.cpp @@ -266,13 +266,13 @@ void CVisualisation::OnAudioData(const float* pAudioData, int iAudioDataLength) return; // Save our audio data in the buffers - auto_ptr pBuffer ( new CAudioBuffer(AUDIO_BUFFER_SIZE) ); + unique_ptr pBuffer ( new CAudioBuffer(AUDIO_BUFFER_SIZE) ); pBuffer->Set(pAudioData, iAudioDataLength); m_vecBuffers.push_back( pBuffer.release() ); if ( (int)m_vecBuffers.size() < m_iNumBuffers) return ; - auto_ptr ptrAudioBuffer ( m_vecBuffers.front() ); + unique_ptr ptrAudioBuffer ( m_vecBuffers.front() ); m_vecBuffers.pop_front(); // Fourier transform the data if the vis wants it... if (m_bWantsFreq) diff --git a/xbmc/cdrip/CDDARipper.cpp b/xbmc/cdrip/CDDARipper.cpp index eb8457e963998..a48448204c464 100644 --- a/xbmc/cdrip/CDDARipper.cpp +++ b/xbmc/cdrip/CDDARipper.cpp @@ -116,7 +116,7 @@ bool CCDDARipper::RipCD() { CFileItemPtr pItem = vecItems[i]; CMusicInfoTagLoaderFactory factory; - auto_ptr pLoader (factory.CreateLoader(pItem->GetPath())); + unique_ptr pLoader (factory.CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) { pLoader->Load(pItem->GetPath(), *pItem->GetMusicInfoTag()); // get tag from file diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp index 0f851c3d2a692..9625a1923289d 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp @@ -49,7 +49,7 @@ bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename) { m_Filename = filename; - auto_ptr pStream(new CDVDSubtitleStream()); + unique_ptr pStream(new CDVDSubtitleStream()); if(!pStream->Open(filename)) return false; @@ -195,7 +195,7 @@ bool CDVDDemuxVobsub::ParseDelay(SState& state, char* line) bool CDVDDemuxVobsub::ParseId(SState& state, char* line) { - auto_ptr stream(new CStream(this)); + unique_ptr stream(new CStream(this)); while(*line == ' ') line++; strncpy(stream->language, line, 2); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h index df9bfd2b436d2..0c75c4adbd5a0 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h @@ -70,8 +70,8 @@ class CDVDDemuxVobsub : public CDVDDemux } STimestamp; std::string m_Filename; - std::auto_ptr m_Input; - std::auto_ptr m_Demuxer; + std::unique_ptr m_Input; + std::unique_ptr m_Demuxer; std::vector m_Timestamps; std::vector::iterator m_Timestamp; std::vector m_Streams; diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp index e70d1b0de7891..f909c32886cae 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp @@ -49,7 +49,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool { // audio/x-xbmc-pcm this is the used codec for AirTunes // (apples audio only streaming) - auto_ptr demuxer(new CDVDDemuxBXA()); + unique_ptr demuxer(new CDVDDemuxBXA()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -64,7 +64,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool { CLog::Log(LOGDEBUG, "DVDFactoryDemuxer: Stream is probably CD audio. Creating CDDA demuxer."); - auto_ptr demuxer(new CDVDDemuxCDDA()); + unique_ptr demuxer(new CDVDDemuxCDDA()); if (demuxer->Open(pInputStream)) { return demuxer.release(); @@ -80,7 +80,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool /* check so we got the meta information as requested in our http header */ if( header->GetValue("icy-metaint").length() > 0 ) { - auto_ptr demuxer(new CDVDDemuxShoutcast()); + unique_ptr demuxer(new CDVDDemuxShoutcast()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -91,7 +91,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool #ifdef HAS_FILESYSTEM_HTSP if (pInputStream->IsStreamType(DVDSTREAM_TYPE_HTSP)) { - auto_ptr demuxer(new CDVDDemuxHTSP()); + unique_ptr demuxer(new CDVDDemuxHTSP()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -114,7 +114,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool /* Used for MediaPortal PVR addon (uses PVR otherstream for playback of rtsp streams) */ if (pOtherStream->IsStreamType(DVDSTREAM_TYPE_FFMPEG)) { - auto_ptr demuxer(new CDVDDemuxFFmpeg()); + unique_ptr demuxer(new CDVDDemuxFFmpeg()); if(demuxer->Open(pOtherStream, streaminfo)) return demuxer.release(); else @@ -129,7 +129,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool if (g_PVRClients->GetPlayingClient(client) && client->HandlesDemuxing()) { - auto_ptr demuxer(new CDVDDemuxPVRClient()); + unique_ptr demuxer(new CDVDDemuxPVRClient()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -144,7 +144,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool streaminfo = !useFastswitch; } - auto_ptr demuxer(new CDVDDemuxFFmpeg()); + unique_ptr demuxer(new CDVDDemuxFFmpeg()); if(demuxer->Open(pInputStream, streaminfo, fileinfo)) return demuxer.release(); else diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp index 74743332199b5..e05b6470fd2f0 100644 --- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp +++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp @@ -59,8 +59,8 @@ bool CDVDFileInfo::GetFileDuration(const std::string &path, int& duration) { - std::auto_ptr input; - std::auto_ptr demux; + std::unique_ptr input; + std::unique_ptr demux; input.reset(CDVDFactoryInputStream::CreateInputStream(NULL, path, "")); if (!input.get()) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 8f7c8a1ce893d..260dd9021ddae 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -3161,7 +3161,7 @@ bool CDVDPlayer::OpenStream(CCurrentStream& current, int iStream, int source, bo if(!m_pSubtitleDemuxer || m_pSubtitleDemuxer->GetFileName() != st.filename) { CLog::Log(LOGNOTICE, "Opening Subtitle file: %s", st.filename.c_str()); - auto_ptr demux(new CDVDDemuxVobsub()); + unique_ptr demux(new CDVDDemuxVobsub()); if(!demux->Open(st.filename, st.filename2)) return false; m_pSubtitleDemuxer = demux.release(); diff --git a/xbmc/dbwrappers/Database.cpp b/xbmc/dbwrappers/Database.cpp index a3dbd2eed986b..e450e6ad34eb3 100644 --- a/xbmc/dbwrappers/Database.cpp +++ b/xbmc/dbwrappers/Database.cpp @@ -143,7 +143,7 @@ std::string CDatabase::PrepareSQL(std::string strStmt, ...) const return strResult; } -std::string CDatabase::GetSingleValue(const std::string &query, std::auto_ptr &ds) +std::string CDatabase::GetSingleValue(const std::string &query, std::unique_ptr &ds) { std::string ret; try diff --git a/xbmc/dbwrappers/Database.h b/xbmc/dbwrappers/Database.h index 5d19749f3e6b2..0117ecdcf97d6 100644 --- a/xbmc/dbwrappers/Database.h +++ b/xbmc/dbwrappers/Database.h @@ -90,7 +90,7 @@ class CDatabase \param ds the dataset to use for the query. \return the value from the query, empty on failure. */ - std::string GetSingleValue(const std::string &query, std::auto_ptr &ds); + std::string GetSingleValue(const std::string &query, std::unique_ptr &ds); /*! * @brief Delete values from a table. @@ -206,9 +206,9 @@ class CDatabase bool m_sqlite; ///< \brief whether we use sqlite (defaults to true) - std::auto_ptr m_pDB; - std::auto_ptr m_pDS; - std::auto_ptr m_pDS2; + std::unique_ptr m_pDB; + std::unique_ptr m_pDS; + std::unique_ptr m_pDS2; private: void InitSettings(DatabaseSettings &dbSettings); diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp index bb61e4dfd9b38..3edcc0077b675 100644 --- a/xbmc/filesystem/Directory.cpp +++ b/xbmc/filesystem/Directory.cpp @@ -285,7 +285,7 @@ bool CDirectory::Create(const CURL& url) try { CURL realURL = URIUtils::SubstitutePath(url); - auto_ptr pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) if(pDirectory->Create(realURL)) return true; @@ -320,7 +320,7 @@ bool CDirectory::Exists(const CURL& url, bool bUseCache /* = true */) if (bPathInCache) return false; } - auto_ptr pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) return pDirectory->Exists(realURL); } @@ -344,7 +344,7 @@ bool CDirectory::Remove(const CURL& url) try { CURL realURL = URIUtils::SubstitutePath(url); - auto_ptr pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) if(pDirectory->Remove(realURL)) { @@ -368,7 +368,7 @@ void CDirectory::FilterFileDirectories(CFileItemList &items, const std::string & CFileItemPtr pItem=items[i]; if (!pItem->m_bIsFolder && pItem->IsFileFolder(EFILEFOLDER_TYPE_ALWAYS)) { - auto_ptr pDirectory(CFileDirectoryFactory::Create(pItem->GetURL(),pItem.get(),mask)); + unique_ptr pDirectory(CFileDirectoryFactory::Create(pItem->GetURL(),pItem.get(),mask)); if (pDirectory.get()) pItem->m_bIsFolder = true; else diff --git a/xbmc/filesystem/File.cpp b/xbmc/filesystem/File.cpp index 0764bcc3d4817..5c3844a998a07 100644 --- a/xbmc/filesystem/File.cpp +++ b/xbmc/filesystem/File.cpp @@ -269,7 +269,7 @@ bool CFile::Open(const CURL& file, const unsigned int flags) SAFE_DELETE(m_pFile); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr pNewUrl(pRedirectEx->m_pNewUrl); m_pFile = pRedirectEx->m_pNewFileImp; delete pRedirectEx; @@ -372,7 +372,7 @@ bool CFile::Exists(const CURL& file, bool bUseCache /* = true */) return false; } - auto_ptr pFile(CFileFactory::CreateLoader(url)); + unique_ptr pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -386,8 +386,8 @@ bool CFile::Exists(const CURL& file, bool bUseCache /* = true */) CLog::Log(LOGDEBUG,"File::Exists - redirecting implementation for %s", file.GetRedacted().c_str()); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr pImp(pRedirectEx->m_pNewFileImp); - auto_ptr pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr pImp(pRedirectEx->m_pNewFileImp); + unique_ptr pNewUrl(pRedirectEx->m_pNewUrl); delete pRedirectEx; if (pImp.get()) @@ -454,7 +454,7 @@ int CFile::Stat(const CURL& file, struct __stat64* buffer) try { - auto_ptr pFile(CFileFactory::CreateLoader(url)); + unique_ptr pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return -1; return pFile->Stat(url, buffer); @@ -467,8 +467,8 @@ int CFile::Stat(const CURL& file, struct __stat64* buffer) CLog::Log(LOGDEBUG,"File::Stat - redirecting implementation for %s", file.GetRedacted().c_str()); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr pImp(pRedirectEx->m_pNewFileImp); - auto_ptr pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr pImp(pRedirectEx->m_pNewFileImp); + unique_ptr pNewUrl(pRedirectEx->m_pNewUrl); delete pRedirectEx; if (pNewUrl.get()) @@ -792,7 +792,7 @@ bool CFile::Delete(const CURL& file) { CURL url(URIUtils::SubstitutePath(file)); - auto_ptr pFile(CFileFactory::CreateLoader(url)); + unique_ptr pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -826,7 +826,7 @@ bool CFile::Rename(const CURL& file, const CURL& newFile) CURL url(URIUtils::SubstitutePath(file)); CURL urlnew(URIUtils::SubstitutePath(newFile)); - auto_ptr pFile(CFileFactory::CreateLoader(url)); + unique_ptr pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -858,7 +858,7 @@ bool CFile::SetHidden(const CURL& file, bool hidden) { CURL url(URIUtils::SubstitutePath(file)); - auto_ptr pFile(CFileFactory::CreateLoader(url)); + unique_ptr pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; diff --git a/xbmc/filesystem/MusicDatabaseDirectory.cpp b/xbmc/filesystem/MusicDatabaseDirectory.cpp index 169dbf7915205..859fd10e8edf4 100644 --- a/xbmc/filesystem/MusicDatabaseDirectory.cpp +++ b/xbmc/filesystem/MusicDatabaseDirectory.cpp @@ -47,7 +47,7 @@ bool CMusicDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(url); items.SetPath(path); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -71,7 +71,7 @@ bool CMusicDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items NODE_TYPE CMusicDatabaseDirectory::GetDirectoryChildType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -82,7 +82,7 @@ NODE_TYPE CMusicDatabaseDirectory::GetDirectoryChildType(const std::string& strP NODE_TYPE CMusicDatabaseDirectory::GetDirectoryType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -93,7 +93,7 @@ NODE_TYPE CMusicDatabaseDirectory::GetDirectoryType(const std::string& strPath) NODE_TYPE CMusicDatabaseDirectory::GetDirectoryParentType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -143,7 +143,7 @@ bool CMusicDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str strLabel = ""; std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strDirectory); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -249,7 +249,7 @@ bool CMusicDatabaseDirectory::ContainsSongs(const std::string &path) bool CMusicDatabaseDirectory::Exists(const CURL& url) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(url); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -263,7 +263,7 @@ bool CMusicDatabaseDirectory::Exists(const CURL& url) bool CMusicDatabaseDirectory::CanCache(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; return pNode->CanCache(); diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp index bb288b00408b7..87eb1f3af4ebd 100644 --- a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp +++ b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp @@ -95,7 +95,7 @@ CDirectoryNode* CDirectoryNode::ParseURL(const std::string& strPath) // returns the database ids of the path, void CDirectoryNode::GetDatabaseInfo(const std::string& strPath, CQueryParams& params) { - auto_ptr pNode(CDirectoryNode::ParseURL(strPath)); + unique_ptr pNode(CDirectoryNode::ParseURL(strPath)); if (!pNode.get()) return; @@ -260,7 +260,7 @@ bool CDirectoryNode::GetChilds(CFileItemList& items) if (CanCache() && items.Load()) return true; - auto_ptr pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); + unique_ptr pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); bool bSuccess=false; if (pNode.get()) diff --git a/xbmc/filesystem/PlaylistFileDirectory.cpp b/xbmc/filesystem/PlaylistFileDirectory.cpp index 0756edb7c7cbb..be2ad61448fdb 100644 --- a/xbmc/filesystem/PlaylistFileDirectory.cpp +++ b/xbmc/filesystem/PlaylistFileDirectory.cpp @@ -41,7 +41,7 @@ namespace XFILE bool CPlaylistFileDirectory::GetDirectory(const CURL& url, CFileItemList& items) { const std::string pathToUrl = url.Get(); - auto_ptr pPlayList (CPlayListFactory::Create(pathToUrl)); + unique_ptr pPlayList (CPlayListFactory::Create(pathToUrl)); if ( NULL != pPlayList.get()) { // load it @@ -63,7 +63,7 @@ namespace XFILE bool CPlaylistFileDirectory::ContainsFiles(const CURL& url) { const std::string pathToUrl = url.Get(); - auto_ptr pPlayList (CPlayListFactory::Create(pathToUrl)); + unique_ptr pPlayList (CPlayListFactory::Create(pathToUrl)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/filesystem/VideoDatabaseDirectory.cpp b/xbmc/filesystem/VideoDatabaseDirectory.cpp index fb65f60dbc433..ec158546083dc 100644 --- a/xbmc/filesystem/VideoDatabaseDirectory.cpp +++ b/xbmc/filesystem/VideoDatabaseDirectory.cpp @@ -48,7 +48,7 @@ bool CVideoDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(url); items.SetPath(path); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -72,7 +72,7 @@ bool CVideoDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items NODE_TYPE CVideoDatabaseDirectory::GetDirectoryChildType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -83,7 +83,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryChildType(const std::string& strP NODE_TYPE CVideoDatabaseDirectory::GetDirectoryType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -94,7 +94,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryType(const std::string& strPath) NODE_TYPE CVideoDatabaseDirectory::GetDirectoryParentType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -110,7 +110,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryParentType(const std::string& str bool CVideoDatabaseDirectory::GetQueryParams(const std::string& strPath, CQueryParams& params) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -143,7 +143,7 @@ bool CVideoDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str strLabel = ""; std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strDirectory); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get() || path.empty()) return false; @@ -304,7 +304,7 @@ bool CVideoDatabaseDirectory::ContainsMovies(const std::string &path) bool CVideoDatabaseDirectory::Exists(const CURL& url) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(url); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -318,7 +318,7 @@ bool CVideoDatabaseDirectory::Exists(const CURL& url) bool CVideoDatabaseDirectory::CanCache(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr pNode(CDirectoryNode::ParseURL(path)); + unique_ptr pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; return pNode->CanCache(); diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp index 4b3d930f206e5..afcd11bfce821 100644 --- a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp +++ b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp @@ -93,7 +93,7 @@ CDirectoryNode* CDirectoryNode::ParseURL(const std::string& strPath) // returns the database ids of the path, void CDirectoryNode::GetDatabaseInfo(const std::string& strPath, CQueryParams& params) { - auto_ptr pNode(CDirectoryNode::ParseURL(strPath)); + unique_ptr pNode(CDirectoryNode::ParseURL(strPath)); if (!pNode.get()) return; @@ -255,7 +255,7 @@ bool CDirectoryNode::GetChilds(CFileItemList& items) if (CanCache() && items.Load()) return true; - auto_ptr pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); + unique_ptr pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); bool bSuccess=false; if (pNode.get()) @@ -296,7 +296,7 @@ void CDirectoryNode::AddQueuingFolder(CFileItemList& items) const return; // hack - as the season node might return episodes - auto_ptr pNode(ParseURL(items.GetPath())); + unique_ptr pNode(ParseURL(items.GetPath())); switch (pNode->GetChildType()) { diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp index 0791d875af10a..399460875ab13 100644 --- a/xbmc/interfaces/Builtins.cpp +++ b/xbmc/interfaces/Builtins.cpp @@ -761,7 +761,7 @@ int CBuiltins::Execute(const std::string& execString) break; } - auto_ptr state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC, items)); + unique_ptr state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC, items)); if (state.get()) items.Sort(state->GetSortMethod()); else diff --git a/xbmc/interfaces/legacy/PlayList.cpp b/xbmc/interfaces/legacy/PlayList.cpp index c7ff80df4a37e..b23dcc17d4f06 100644 --- a/xbmc/interfaces/legacy/PlayList.cpp +++ b/xbmc/interfaces/legacy/PlayList.cpp @@ -80,7 +80,7 @@ namespace XBMCAddon // load a playlist like .m3u, .pls // first get correct factory to load playlist - std::auto_ptr pPlayList (CPlayListFactory::Create(item)); + std::unique_ptr pPlayList (CPlayListFactory::Create(item)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/music/MusicInfoLoader.cpp b/xbmc/music/MusicInfoLoader.cpp index 00834c087f44c..7b51fd7c965cf 100644 --- a/xbmc/music/MusicInfoLoader.cpp +++ b/xbmc/music/MusicInfoLoader.cpp @@ -111,7 +111,7 @@ bool CMusicInfoLoader::LoadAdditionalTagInfo(CFileItem* pItem) CLog::Log(LOGDEBUG, "Loading additional tag info for file %s", path.c_str()); // we load up the actual tag for this file - auto_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); + unique_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); if (NULL != pLoader.get()) { CMusicInfoTag tag; @@ -196,7 +196,7 @@ bool CMusicInfoLoader::LoadItemLookup(CFileItem* pItem) { // Nothing found, load tag from file, // always try to load cddb info // get correct tag parser - auto_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); + unique_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) // get tag pLoader->Load(pItem->GetPath(), *pItem->GetMusicInfoTag()); diff --git a/xbmc/music/MusicThumbLoader.cpp b/xbmc/music/MusicThumbLoader.cpp index 83544974693d7..91aa6e25e6916 100644 --- a/xbmc/music/MusicThumbLoader.cpp +++ b/xbmc/music/MusicThumbLoader.cpp @@ -239,7 +239,7 @@ bool CMusicThumbLoader::FillLibraryArt(CFileItem &item) bool CMusicThumbLoader::GetEmbeddedThumb(const std::string &path, EmbeddedArt &art) { - auto_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); + unique_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); CMusicInfoTag tag; if (NULL != pLoader.get()) pLoader->Load(path, tag, &art); diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp index 3b20472e0e20d..cb17456a6ebca 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp @@ -532,7 +532,7 @@ INFO_RET CMusicInfoScanner::ScanTags(const CFileItemList& items, CFileItemList& CMusicInfoTag& tag = *pItem->GetMusicInfoTag(); if (!tag.Loaded()) { - auto_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); + unique_ptr pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) pLoader->Load(pItem->GetPath(), tag); } diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp index b635f746c6a81..2e6f6329d0d75 100644 --- a/xbmc/music/windows/GUIWindowMusicBase.cpp +++ b/xbmc/music/windows/GUIWindowMusicBase.cpp @@ -619,7 +619,7 @@ void CGUIWindowMusicBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItem { if (pItem->IsPlayList()) { - auto_ptr pPlayList (CPlayListFactory::Create(*pItem)); + unique_ptr pPlayList (CPlayListFactory::Create(*pItem)); if (pPlayList.get()) { // load it @@ -919,7 +919,7 @@ void CGUIWindowMusicBase::LoadPlayList(const std::string& strPlayList) // load a playlist like .m3u, .pls // first get correct factory to load playlist - auto_ptr pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr pPlayList (CPlayListFactory::Create(strPlayList)); if (pPlayList.get()) { // load it diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp index 2a95cc91743e0..58e7252ad90ad 100644 --- a/xbmc/music/windows/GUIWindowMusicNav.cpp +++ b/xbmc/music/windows/GUIWindowMusicNav.cpp @@ -751,7 +751,7 @@ bool CGUIWindowMusicNav::GetSongsFromPlayList(const std::string& strPlayList, CF items.SetPath(strPlayList); CLog::Log(LOGDEBUG,"CGUIWindowMusicNav, opening playlist [%s]", strPlayList.c_str()); - auto_ptr pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr pPlayList (CPlayListFactory::Create(strPlayList)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp index 9e69ff4f44b7c..86b80752fcc67 100644 --- a/xbmc/network/WebServer.cpp +++ b/xbmc/network/WebServer.cpp @@ -754,7 +754,7 @@ int CWebServer::CreateFileDownloadResponse(IHTTPRequestHandler *handler, struct if (request.method != HEAD) { uint64_t totalLength = 0; - std::auto_ptr context(new HttpFileDownloadContext()); + std::unique_ptr context(new HttpFileDownloadContext()); context->file = file; context->contentType = mimeType; context->boundaryWritten = false; diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp index fd2f0b69d209c..c3e2f8616d2df 100644 --- a/xbmc/pictures/GUIWindowPictures.cpp +++ b/xbmc/pictures/GUIWindowPictures.cpp @@ -559,7 +559,7 @@ void CGUIWindowPictures::OnItemLoaded(CFileItem *pItem) void CGUIWindowPictures::LoadPlayList(const std::string& strPlayList) { CLog::Log(LOGDEBUG,"CGUIWindowPictures::LoadPlayList()... converting playlist into slideshow: %s", strPlayList.c_str()); - auto_ptr pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr pPlayList (CPlayListFactory::Create(strPlayList)); if ( NULL != pPlayList.get()) { if (!pPlayList->Load(strPlayList)) diff --git a/xbmc/playlists/PlayList.cpp b/xbmc/playlists/PlayList.cpp index de15e9225c6fa..2174fb0408492 100644 --- a/xbmc/playlists/PlayList.cpp +++ b/xbmc/playlists/PlayList.cpp @@ -461,7 +461,7 @@ bool CPlayList::LoadData(const std::string& strData) bool CPlayList::Expand(int position) { CFileItemPtr item = m_vecItems[position]; - std::auto_ptr playlist (CPlayListFactory::Create(*item.get())); + std::unique_ptr playlist (CPlayListFactory::Create(*item.get())); if ( NULL == playlist.get()) return false; diff --git a/xbmc/playlists/PlayListPLS.cpp b/xbmc/playlists/PlayListPLS.cpp index 312af796dfbf8..f685b56b9beb1 100644 --- a/xbmc/playlists/PlayListPLS.cpp +++ b/xbmc/playlists/PlayListPLS.cpp @@ -379,7 +379,7 @@ bool CPlayListASX::LoadData(istream& stream) value = XMLUtils::GetAttribute(pElement, "href"); if (!value.empty()) { // found an entryref, let's try loading that url - auto_ptr playlist(CPlayListFactory::Create(value)); + unique_ptr playlist(CPlayListFactory::Create(value)); if (NULL != playlist.get()) if (playlist->Load(value)) Add(*playlist); diff --git a/xbmc/utils/AutoPtrHandle.h b/xbmc/utils/AutoPtrHandle.h index cd72c3ae640b0..8a3b4dcf9e3ee 100644 --- a/xbmc/utils/AutoPtrHandle.h +++ b/xbmc/utils/AutoPtrHandle.h @@ -66,7 +66,7 @@ class CAutoPtrSocket }; /* - * This template class is very similar to the standard "auto_ptr", but it is + * This template class is very similar to the standard "unique_ptr", but it is * used for *array* pointers rather than *object* pointers, i.e. the pointer * passed to it must have been allocated with "new[]", and "auto_aptr" will * delete it with "delete[]". diff --git a/xbmc/utils/DatabaseUtils.cpp b/xbmc/utils/DatabaseUtils.cpp index ae523055bbd55..d2fcb31074554 100644 --- a/xbmc/utils/DatabaseUtils.cpp +++ b/xbmc/utils/DatabaseUtils.cpp @@ -352,7 +352,7 @@ bool DatabaseUtils::GetFieldValue(const dbiplus::field_value &fieldValue, CVaria return false; } -bool DatabaseUtils::GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::auto_ptr &dataset, DatabaseResults &results) +bool DatabaseUtils::GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::unique_ptr &dataset, DatabaseResults &results) { if (dataset->num_rows() == 0) return true; diff --git a/xbmc/utils/DatabaseUtils.h b/xbmc/utils/DatabaseUtils.h index 3ac9f36183051..6ee0a7c7bd452 100644 --- a/xbmc/utils/DatabaseUtils.h +++ b/xbmc/utils/DatabaseUtils.h @@ -152,7 +152,7 @@ class DatabaseUtils static bool GetSelectFields(const Fields &fields, const MediaType &mediaType, FieldList &selectFields); static bool GetFieldValue(const dbiplus::field_value &fieldValue, CVariant &variantValue); - static bool GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::auto_ptr &dataset, DatabaseResults &results); + static bool GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::unique_ptr &dataset, DatabaseResults &results); static std::string BuildLimitClause(int end, int start = 0); diff --git a/xbmc/utils/SortUtils.cpp b/xbmc/utils/SortUtils.cpp index 9d364c44ba9f6..a9fa99aa16696 100644 --- a/xbmc/utils/SortUtils.cpp +++ b/xbmc/utils/SortUtils.cpp @@ -725,7 +725,7 @@ void SortUtils::Sort(const SortDescription &sortDescription, SortItems& items) Sort(sortDescription.sortBy, sortDescription.sortOrder, sortDescription.sortAttributes, items, sortDescription.limitEnd, sortDescription.limitStart); } -bool SortUtils::SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::auto_ptr &dataset, DatabaseResults &results) +bool SortUtils::SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::unique_ptr &dataset, DatabaseResults &results) { FieldList fields; if (!DatabaseUtils::GetSelectFields(SortUtils::GetFieldsForSorting(sortDescription.sortBy), mediaType, fields)) diff --git a/xbmc/utils/SortUtils.h b/xbmc/utils/SortUtils.h index 0873e1ef76e33..9faff876ba334 100644 --- a/xbmc/utils/SortUtils.h +++ b/xbmc/utils/SortUtils.h @@ -135,7 +135,7 @@ class SortUtils static void Sort(SortBy sortBy, SortOrder sortOrder, SortAttribute attributes, SortItems& items, int limitEnd = -1, int limitStart = 0); static void Sort(const SortDescription &sortDescription, DatabaseResults& items); static void Sort(const SortDescription &sortDescription, SortItems& items); - static bool SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::auto_ptr &dataset, DatabaseResults &results); + static bool SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::unique_ptr &dataset, DatabaseResults &results); static const Fields& GetFieldsForSorting(SortBy sortBy); static std::string RemoveArticles(const std::string &label); diff --git a/xbmc/utils/test/TestDatabaseUtils.cpp b/xbmc/utils/test/TestDatabaseUtils.cpp index c26e881ae0862..2f213efeec405 100644 --- a/xbmc/utils/test/TestDatabaseUtils.cpp +++ b/xbmc/utils/test/TestDatabaseUtils.cpp @@ -1293,7 +1293,7 @@ TEST(TestDatabaseUtils, GetFieldValue) // TEST(TestDatabaseUtils, GetDatabaseResults) // { // static bool GetDatabaseResults(MediaType mediaType, const FieldList &fields, -// const std::auto_ptr &dataset, +// const std::unique_ptr &dataset, // DatabaseResults &results); // } diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index e5b478aef5cf6..4346379f91dd2 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -1169,7 +1169,7 @@ int CVideoDatabase::GetEpisodeId(const std::string& strFilenameAndPath, int idEp if (NULL == m_pDS.get()) return -1; // need this due to the nested GetEpisodeInfo query - auto_ptr pDS; + unique_ptr pDS; pDS.reset(m_pDB->CreateDataset()); if (NULL == pDS.get()) return -1; @@ -3220,7 +3220,7 @@ void CVideoDatabase::DeleteTag(int idTag, VIDEODB_CONTENT_TYPE mediaType) } } -void CVideoDatabase::GetDetailsFromDB(auto_ptr &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset) +void CVideoDatabase::GetDetailsFromDB(unique_ptr &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset) { GetDetailsFromDB(pDS->get_sql_record(), min, max, offsets, details, idxOffset); } @@ -3319,7 +3319,7 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const CStreamDetails& details = tag.m_streamDetails; details.Reset(); - auto_ptr pDS(m_pDB->CreateDataset()); + unique_ptr pDS(m_pDB->CreateDataset()); try { std::string strSQL = PrepareSQL("SELECT * FROM streamdetails WHERE idFile = %i", tag.m_iFileId); @@ -3434,7 +3434,7 @@ bool CVideoDatabase::GetResumePoint(CVideoInfoTag& tag) return match; } -CVideoInfoTag CVideoDatabase::GetDetailsForMovie(auto_ptr &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForMovie(unique_ptr &pDS, bool getDetails /* = false */) { return GetDetailsForMovie(pDS->get_sql_record(), getDetails); } @@ -3496,7 +3496,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForMovie(const dbiplus::sql_record* cons return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(auto_ptr &pDS, bool getDetails /* = false */, CFileItem* item /* = NULL */) +CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(unique_ptr &pDS, bool getDetails /* = false */, CFileItem* item /* = NULL */) { return GetDetailsForTvShow(pDS->get_sql_record(), getDetails, item); } @@ -3550,7 +3550,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(const dbiplus::sql_record* con return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(auto_ptr &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(unique_ptr &pDS, bool getDetails /* = false */) { return GetDetailsForEpisode(pDS->get_sql_record(), getDetails); } @@ -3607,7 +3607,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo(auto_ptr &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo(unique_ptr &pDS, bool getDetails /* = false */) { return GetDetailsForMusicVideo(pDS->get_sql_record(), getDetails); } @@ -8330,11 +8330,11 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFiles /* = if (NULL == m_pDS2.get()) return; // create a 3rd dataset as well as GetEpisodeDetails() etc. uses m_pDS2, and we need to do 3 nested queries on tv shows - auto_ptr pDS; + unique_ptr pDS; pDS.reset(m_pDB->CreateDataset()); if (NULL == pDS.get()) return; - auto_ptr pDS2; + unique_ptr pDS2; pDS2.reset(m_pDB->CreateDataset()); if (NULL == pDS2.get()) return; diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 8012bd59c79a3..fcab0a865d9ad 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -823,20 +823,20 @@ class CVideoDatabase : public CDatabase void DeleteStreamDetails(int idFile); CVideoInfoTag GetDetailsByTypeAndId(VIDEODB_CONTENT_TYPE type, int id); - CVideoInfoTag GetDetailsForMovie(std::auto_ptr &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForMovie(std::unique_ptr &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForMovie(const dbiplus::sql_record* const record, bool getDetails = false); - CVideoInfoTag GetDetailsForTvShow(std::auto_ptr &pDS, bool getDetails = false, CFileItem* item = NULL); + CVideoInfoTag GetDetailsForTvShow(std::unique_ptr &pDS, bool getDetails = false, CFileItem* item = NULL); CVideoInfoTag GetDetailsForTvShow(const dbiplus::sql_record* const record, bool getDetails = false, CFileItem* item = NULL); - CVideoInfoTag GetDetailsForEpisode(std::auto_ptr &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForEpisode(std::unique_ptr &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForEpisode(const dbiplus::sql_record* const record, bool getDetails = false); - CVideoInfoTag GetDetailsForMusicVideo(std::auto_ptr &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForMusicVideo(std::unique_ptr &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForMusicVideo(const dbiplus::sql_record* const record, bool getDetails = false); bool GetPeopleNav(const std::string& strBaseDir, CFileItemList& items, const char *type, int idContent = -1, const Filter &filter = Filter(), bool countOnly = false); bool GetNavCommon(const std::string& strBaseDir, CFileItemList& items, const char *type, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false); void GetCast(int media_id, const std::string &media_type, std::vector &cast); void GetTags(int media_id, const std::string &media_type, std::vector &tags); - void GetDetailsFromDB(std::auto_ptr &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); + void GetDetailsFromDB(std::unique_ptr &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); void GetDetailsFromDB(const dbiplus::sql_record* const record, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); std::string GetValueString(const CVideoInfoTag &details, int min, int max, const SDbTableOffsets *offsets) const; diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index 6642fb3e7d762..c78b5bdaf7289 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -822,7 +822,7 @@ void CGUIWindowVideoBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItem // just an item if (pItem->IsPlayList()) { - auto_ptr pPlayList (CPlayListFactory::Create(*pItem)); + unique_ptr pPlayList (CPlayListFactory::Create(*pItem)); if (pPlayList.get()) { // load it @@ -1545,7 +1545,7 @@ void CGUIWindowVideoBase::LoadPlayList(const std::string& strPlayList, int iPlay // load a playlist like .m3u, .pls // first get correct factory to load playlist - auto_ptr pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr pPlayList (CPlayListFactory::Create(strPlayList)); if (pPlayList.get()) { // load it diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp index 83fc22dbfa0b3..2b3d2adc38f6d 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp @@ -197,10 +197,10 @@ return out.str(); } -std::auto_ptr IdlePreset::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) +std::unique_ptr IdlePreset::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { std::istringstream in(presetText()); - return std::auto_ptr(new Preset(in, IDLE_PRESET_NAME, presetInputs, presetOutputs)); + return std::unique_ptr(new Preset(in, IDLE_PRESET_NAME, presetInputs, presetOutputs)); } diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp index 15738ed22ffc3..233aa8e2059b5 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp @@ -13,7 +13,7 @@ class IdlePreset { /// \param presetInputs the preset inputs instance to associate with the preset /// \param presetOutputs the preset output instance to associate with the preset /// \returns a newly allocated auto pointer of an idle preset instance - static std::auto_ptr allocate(PresetInputs & presetInputs, PresetOutputs & presetOutputs); + static std::unique_ptr allocate(PresetInputs & presetInputs, PresetOutputs & presetOutputs); private: static std::string presetText(); static const std::string IDLE_PRESET_NAME; diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp index 3971beb60eacd..a82159620bcb3 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp @@ -43,7 +43,7 @@ class PresetIterator { /// \param presetInputs the preset inputs to associate with the preset upon construction /// \param presetOutputs the preset outputs to associate with the preset upon construction /// \returns an autopointer of the newly allocated preset - std::auto_ptr allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs); + std::unique_ptr allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs); /// Set the chooser asocciated with this iterator void setChooser(const PresetChooser & chooser); @@ -70,7 +70,7 @@ class PresetChooser { /// \param presetInputs the preset inputs to associate with the preset upon construction /// \param presetOutputs the preset outputs to associate with the preset upon construction /// \returns an auto pointer of the newly allocated preset - std::auto_ptr directoryIndex(std::size_t index, PresetInputs & presetInputs, + std::unique_ptr directoryIndex(std::size_t index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const; /// Gets the number of presets last believed to exist in the preset loader's filename collection @@ -142,7 +142,7 @@ inline bool PresetIterator::operator ==(const PresetIterator & presetPos) const return (*presetPos == **this); } -inline std::auto_ptr PresetIterator::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { +inline std::unique_ptr PresetIterator::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { return m_presetChooser->directoryIndex(m_currentIndex, presetInputs, presetOutputs); } @@ -188,7 +188,7 @@ inline bool PresetChooser::empty() const { return m_presetLoader->getNumPresets() == 0; } -inline std::auto_ptr PresetChooser::directoryIndex(std::size_t index, PresetInputs & presetInputs, +inline std::unique_ptr PresetChooser::directoryIndex(std::size_t index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const { return m_presetLoader->loadPreset(index, presetInputs, presetOutputs); diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp index d0a281ff64578..a91a132f53a70 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp @@ -130,7 +130,7 @@ void PresetLoader::rescan() } -std::auto_ptr PresetLoader::loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const +std::unique_ptr PresetLoader::loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const { // Check that index isn't insane @@ -138,7 +138,7 @@ std::auto_ptr PresetLoader::loadPreset(unsigned int index, PresetInputs assert(index < m_entries.size()); // Return a new autopointer to a preset - return std::auto_ptr(new Preset(m_entries[index], m_presetNames[index], presetInputs, presetOutputs)); + return std::unique_ptr(new Preset(m_entries[index], m_presetNames[index], presetInputs, presetOutputs)); } void PresetLoader::handleDirectoryError() diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp index 663432f3d52aa..d13ce513f9f1b 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp @@ -36,7 +36,7 @@ class PresetLoader { /** Load a preset by specifying a filename of the directory (that is, NOT full path) */ /** Autopointers: when you take it, I leave it */ - std::auto_ptr loadPreset(unsigned int index, PresetInputs & presetInputs, + std::unique_ptr loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const; /// Add a preset to the loader's collection. diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp index f764295c0f03b..e6f0f813e420c 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp @@ -800,7 +800,7 @@ void projectM::selectPreset ( unsigned int index ) timeKeeper->StartPreset(); } -void projectM::switchPreset(std::auto_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs) { +void projectM::switchPreset(std::unique_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs) { if (_settings.shuffleEnabled) *m_presetPos = m_presetChooser->weightedRandom(); diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp index c32921572a3db..796eaa838485b 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp @@ -262,7 +262,7 @@ class projectM int count; float fpsstart; - void switchPreset(std::auto_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); + void switchPreset(std::unique_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); void readConfig(const Settings configpm); void projectM_init(int gx, int gy, int fps, int texsize, int width, int height, int xpos, int ypos, bool useFBO); void projectM_reset(); @@ -287,10 +287,10 @@ class projectM PresetChooser * m_presetChooser; /// Currently loaded preset - std::auto_ptr m_activePreset; + std::unique_ptr m_activePreset; /// Destination preset when smooth preset switching - std::auto_ptr m_activePreset2; + std::unique_ptr m_activePreset2; /// All readonly variables which are passed as inputs to presets PresetInputs presetInputs; diff --git a/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch b/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch index 83741189bd149..1500e5f766bee 100644 --- a/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch +++ b/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch @@ -109,7 +109,7 @@ Index: projectM.hpp std::string menuFontURL; @@ -265,7 +267,7 @@ - void switchPreset(std::auto_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); + void switchPreset(std::unique_ptr & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); void readConfig(const std::string & configFile); - void projectM_init(int gx, int gy, int fps, int texsize, int width, int height); + void projectM_init(int gx, int gy, int fps, int texsize, int width, int height, int xpos, int ypos); diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index 4ad8cc2d8546a..c8ccc85dfc3eb 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -566,7 +566,7 @@ void CGUIMediaWindow::ClearFileItems() // \brief Sorts Fileitems based on the sort method and sort oder provided by guiViewState void CGUIMediaWindow::SortItems(CFileItemList &items) { - auto_ptr guiState(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr guiState(CGUIViewState::GetViewState(GetID(), items)); if (guiState.get()) { @@ -622,7 +622,7 @@ void CGUIMediaWindow::FormatItemLabels(CFileItemList &items, const LABEL_MASKS & // \brief Prepares and adds the fileitems list/thumb panel void CGUIMediaWindow::FormatAndSort(CFileItemList &items) { - auto_ptr viewState(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr viewState(CGUIViewState::GetViewState(GetID(), items)); if (viewState.get()) { @@ -1038,7 +1038,7 @@ bool CGUIMediaWindow::OnClick(int iItem) if (plugin && plugin->Provides(CPluginSource::AUDIO)) { CFileItemList items; - auto_ptr state(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr state(CGUIViewState::GetViewState(GetID(), items)); autoplay = state.get() && state->AutoPlayNextItem(); } } diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h index bca88e3661305..f961efb76f5df 100644 --- a/xbmc/windows/GUIMediaWindow.h +++ b/xbmc/windows/GUIMediaWindow.h @@ -163,7 +163,7 @@ class CGUIMediaWindow : public CGUIWindow CFileItemList* m_vecItems; CFileItemList* m_unfilteredItems; ///< \brief items prior to filtering using FilterItems() CDirectoryHistory m_history; - std::auto_ptr m_guiState; + std::unique_ptr m_guiState; // save control state on window exit int m_iLastControl; diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp index 5c483772acd13..1f7b88b31fae5 100644 --- a/xbmc/windows/GUIWindowFileManager.cpp +++ b/xbmc/windows/GUIWindowFileManager.cpp @@ -594,7 +594,7 @@ void CGUIWindowFileManager::OnStart(CFileItem *pItem) if (pItem->IsPlayList()) { std::string strPlayList = pItem->GetPath(); - auto_ptr pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr pPlayList (CPlayListFactory::Create(strPlayList)); if (NULL != pPlayList.get()) { if (!pPlayList->Load(strPlayList))