From 57fc960f35480e45e104ad93e8b71654390f7b54 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 6 Jan 2019 11:28:37 -0800 Subject: [PATCH] Cleaned up some unnecessary boost cruft. --- src/core/audio/Buffer.h | 1 - src/core/audio/IStream.h | 1 - src/core/audio/PlaybackService.cpp | 5 +---- src/core/audio/Stream.h | 1 - src/core/db/Connection.cpp | 3 +-- src/core/db/Connection.h | 5 ++--- src/core/db/ScopedTransaction.h | 6 +++--- src/core/db/Statement.h | 5 ++--- src/core/library/IQuery.h | 1 - src/core/library/Indexer.cpp | 3 +-- src/core/library/Indexer.h | 5 +++-- src/core/library/LocalLibrary.cpp | 2 +- src/core/library/LocalLibrary.h | 9 ++------- src/core/pch.hpp | 4 ---- src/core/support/Duration.cpp | 4 ++-- src/musikcube/app/window/TransportWindow.cpp | 3 +-- src/plugins/taglib_plugin/TaglibMetadataReader.cpp | 1 - 17 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/core/audio/Buffer.h b/src/core/audio/Buffer.h index c3c944bbe..3d073c6c1 100644 --- a/src/core/audio/Buffer.h +++ b/src/core/audio/Buffer.h @@ -35,7 +35,6 @@ #pragma once #include -#include #include namespace musik { namespace core { namespace audio { diff --git a/src/core/audio/IStream.h b/src/core/audio/IStream.h index 5c6cce84a..3d8012e69 100644 --- a/src/core/audio/IStream.h +++ b/src/core/audio/IStream.h @@ -41,7 +41,6 @@ #include #include -#include #include namespace musik { namespace core { namespace audio { diff --git a/src/core/audio/PlaybackService.cpp b/src/core/audio/PlaybackService.cpp index 764932827..4397dc2e4 100755 --- a/src/core/audio/PlaybackService.cpp +++ b/src/core/audio/PlaybackService.cpp @@ -47,8 +47,6 @@ #include #include -#include - using namespace musik::core::library; using namespace musik::core; using namespace musik::core::prefs; @@ -795,8 +793,7 @@ double PlaybackService::GetDuration() { } if (track) { - return boost::lexical_cast( - track->GetString(constants::Track::DURATION)); + std::stod(track->GetString(constants::Track::DURATION)); } return 0.0f; diff --git a/src/core/audio/Stream.h b/src/core/audio/Stream.h index c6fe535d5..b5d667102 100644 --- a/src/core/audio/Stream.h +++ b/src/core/audio/Stream.h @@ -41,7 +41,6 @@ #include #include -#include #include namespace musik { namespace core { namespace audio { diff --git a/src/core/db/Connection.cpp b/src/core/db/Connection.cpp index e607071ef..eff76153d 100644 --- a/src/core/db/Connection.cpp +++ b/src/core/db/Connection.cpp @@ -35,7 +35,6 @@ #include "pch.hpp" #include -#include #include static std::mutex globalMutex; @@ -130,7 +129,7 @@ void Connection::Initialize(unsigned int cache) { // Divide by 4 to since the page_size is 4096 // Total cache is the same as page_size*cache_size cache = cache / 4; - std::string cacheSize("PRAGMA cache_size=" + boost::lexical_cast(cache)); + std::string cacheSize("PRAGMA cache_size=" + std::to_string(cache)); sqlite3_exec(this->connection,cacheSize.c_str(), nullptr, nullptr, nullptr); // size * 1.5kb = 6Mb cache } diff --git a/src/core/db/Connection.h b/src/core/db/Connection.h index 28539239e..fa2b6545e 100644 --- a/src/core/db/Connection.h +++ b/src/core/db/Connection.h @@ -41,8 +41,6 @@ #include #include -#include - struct sqlite3; struct sqlite3_stmt; @@ -55,9 +53,10 @@ namespace musik { namespace core { namespace db { Error = 1 } ReturnCode; - class Connection : boost::noncopyable { + class Connection { public: Connection(); + Connection(const Connection&) = delete; ~Connection(); int Open(const std::string &database, unsigned int options = 0, unsigned int cache = 0); diff --git a/src/core/db/ScopedTransaction.h b/src/core/db/ScopedTransaction.h index fd257d0d2..c9d5799f2 100644 --- a/src/core/db/ScopedTransaction.h +++ b/src/core/db/ScopedTransaction.h @@ -36,16 +36,16 @@ #include #include -#include -#include namespace musik { namespace core { namespace db { class Connection; - class ScopedTransaction : boost::noncopyable { + class ScopedTransaction { public: ScopedTransaction(Connection &connection); + ScopedTransaction(const ScopedTransaction&) = delete; + ~ScopedTransaction(); void Cancel(); diff --git a/src/core/db/Statement.h b/src/core/db/Statement.h index d2cf5a476..88dbe75c7 100644 --- a/src/core/db/Statement.h +++ b/src/core/db/Statement.h @@ -36,8 +36,6 @@ #include #include -#include -#include struct sqlite3_stmt; @@ -45,9 +43,10 @@ namespace musik { namespace core { namespace db { class Connection; - class Statement : boost::noncopyable { + class Statement { public: Statement(const char* sql,Connection &connection); + Statement(const Statement&) = delete; virtual ~Statement(); void BindInt32(int position, int bindInt); diff --git a/src/core/library/IQuery.h b/src/core/library/IQuery.h index d7954fe07..2ca6db22c 100755 --- a/src/core/library/IQuery.h +++ b/src/core/library/IQuery.h @@ -38,7 +38,6 @@ #include #include -#include #include #include diff --git a/src/core/library/Indexer.cpp b/src/core/library/Indexer.cpp index 30d719453..29ab05798 100644 --- a/src/core/library/Indexer.cpp +++ b/src/core/library/Indexer.cpp @@ -54,7 +54,6 @@ #include -#include #include #include @@ -444,7 +443,7 @@ void Indexer::SyncDirectory( boost::filesystem::directory_iterator end; boost::filesystem::directory_iterator file(path); - std::string pathIdStr = boost::lexical_cast(pathId); + std::string pathIdStr = std::to_string(pathId); std::vector threads; for( ; file != end && !this->Bail(); file++) { diff --git a/src/core/library/Indexer.h b/src/core/library/Indexer.h index 90757b313..f03916363 100644 --- a/src/core/library/Indexer.h +++ b/src/core/library/Indexer.h @@ -60,14 +60,15 @@ namespace musik { namespace core { class Indexer : public musik::core::IIndexer, public musik::core::sdk::IIndexerWriter, - public musik::core::sdk::IIndexerNotifier, - private boost::noncopyable + public musik::core::sdk::IIndexerNotifier { public: Indexer( const std::string& libraryPath, const std::string& dbFilename); + Indexer(const Indexer&) = delete; + virtual ~Indexer(); /* IIndexer */ diff --git a/src/core/library/LocalLibrary.cpp b/src/core/library/LocalLibrary.cpp index 60da14449..c8ee038fd 100644 --- a/src/core/library/LocalLibrary.cpp +++ b/src/core/library/LocalLibrary.cpp @@ -82,7 +82,7 @@ LocalLibrary::LocalLibrary(std::string name,int id) , id(id) , exit(false) , messageQueue(nullptr) { - this->identifier = boost::lexical_cast(id); + this->identifier = std::to_string(id); this->db.Open(this->GetDatabaseFilename().c_str()); LocalLibrary::CreateDatabase(this->db); diff --git a/src/core/library/LocalLibrary.h b/src/core/library/LocalLibrary.h index ca3584542..13213a9e5 100644 --- a/src/core/library/LocalLibrary.h +++ b/src/core/library/LocalLibrary.h @@ -34,10 +34,6 @@ #pragma once -#include -#include -#include - #include #include @@ -50,7 +46,6 @@ #include #include -#include #include #include @@ -59,8 +54,7 @@ namespace musik { namespace core { namespace library { class LocalLibrary : public ILibrary, public musik::core::runtime::IMessageTarget, - public std::enable_shared_from_this, - boost::noncopyable + public std::enable_shared_from_this { public: using LocalQuery = musik::core::db::LocalQueryBase; @@ -68,6 +62,7 @@ namespace musik { namespace core { namespace library { static ILibraryPtr Create(std::string name, int id); + LocalLibrary(const LocalLibrary&) = delete; virtual ~LocalLibrary(); /* ILibrary */ diff --git a/src/core/pch.hpp b/src/core/pch.hpp index 97fdaea02..58ca346ce 100644 --- a/src/core/pch.hpp +++ b/src/core/pch.hpp @@ -34,11 +34,7 @@ #ifdef WIN32 #include - #include - #include - #include - #include #include #endif \ No newline at end of file diff --git a/src/core/support/Duration.cpp b/src/core/support/Duration.cpp index 464575010..d6dfb2524 100755 --- a/src/core/support/Duration.cpp +++ b/src/core/support/Duration.cpp @@ -34,7 +34,7 @@ #include "pch.hpp" #include "Duration.h" -#include +#include namespace musik { namespace core { namespace duration { @@ -52,7 +52,7 @@ namespace musik { namespace core { namespace duration { std::string Duration(const std::string& str) { if (str.size()) { - int seconds = boost::lexical_cast(str); + int seconds = std::stoi(str); return Duration(seconds); } diff --git a/src/musikcube/app/window/TransportWindow.cpp b/src/musikcube/app/window/TransportWindow.cpp index 9a1b79eaa..fb78bc3af 100755 --- a/src/musikcube/app/window/TransportWindow.cpp +++ b/src/musikcube/app/window/TransportWindow.cpp @@ -53,7 +53,6 @@ #include #include -#include #include #include @@ -229,7 +228,7 @@ struct musik::cube::TransportDisplayCache { this->track->GetString(constants::Track::DURATION); if (duration.size()) { - secondsTotal = boost::lexical_cast(duration); + secondsTotal = std::stoi(duration); } } diff --git a/src/plugins/taglib_plugin/TaglibMetadataReader.cpp b/src/plugins/taglib_plugin/TaglibMetadataReader.cpp index 751f480cc..9524551f2 100644 --- a/src/plugins/taglib_plugin/TaglibMetadataReader.cpp +++ b/src/plugins/taglib_plugin/TaglibMetadataReader.cpp @@ -82,7 +82,6 @@ #include #include #include -#include #include #ifdef WIN32