diff --git a/client/clientConnection.cpp b/client/clientConnection.cpp index 72e6a5dd..c5c8fb55 100644 --- a/client/clientConnection.cpp +++ b/client/clientConnection.cpp @@ -16,7 +16,6 @@ along with this program. If not, see . ***/ -#include #include #include #include "common/log.h" @@ -59,7 +58,7 @@ void ClientConnection::socketRead(void* _to, size_t _bytes) void ClientConnection::start() { tcp::resolver resolver(io_service_); - tcp::resolver::query query(tcp::v4(), host_, boost::lexical_cast(port_), boost::asio::ip::resolver_query_base::numeric_service); + tcp::resolver::query query(tcp::v4(), host_, std::to_string(port_), boost::asio::ip::resolver_query_base::numeric_service); auto iterator = resolver.resolve(query); logO << "Connecting\n"; socket_.reset(new tcp::socket(io_service_)); diff --git a/client/snapClient.cpp b/client/snapClient.cpp index 79e24cde..8d44e833 100644 --- a/client/snapClient.cpp +++ b/client/snapClient.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include "common/daemon.h" @@ -41,7 +40,7 @@ PcmDevice getPcmDevice(const std::string& soundcard) try { - soundcardIdx = boost::lexical_cast(soundcard); + soundcardIdx = std::stoi(soundcard); for (auto dev: pcmDevices) if (dev.idx == soundcardIdx) return dev; diff --git a/common/log.h b/common/log.h index eaa15f6c..8be0ae86 100644 --- a/common/log.h +++ b/common/log.h @@ -24,6 +24,7 @@ #include #include #include +#include #define logD std::clog << kDbg #define logO std::clog << kOut diff --git a/message/sampleFormat.cpp b/message/sampleFormat.cpp index 3e7be3a8..f098e0e9 100644 --- a/message/sampleFormat.cpp +++ b/message/sampleFormat.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include "sampleFormat.h" @@ -62,9 +61,9 @@ void SampleFormat::setFormat(const std::string& format) boost::split(strs, format, boost::is_any_of(":")); if (strs.size() == 3) setFormat( - boost::lexical_cast(strs[0]), - boost::lexical_cast(strs[1]), - boost::lexical_cast(strs[2])); + std::stoul(strs[0]), + std::stoul(strs[1]), + std::stoul(strs[2])); } diff --git a/server/controlSession.cpp b/server/controlSession.cpp index 1483a8cd..ddf2c9b8 100644 --- a/server/controlSession.cpp +++ b/server/controlSession.cpp @@ -16,7 +16,6 @@ along with this program. If not, see . ***/ -#include #include #include #include "controlSession.h" diff --git a/server/encoder/flacEncoder.cpp b/server/encoder/flacEncoder.cpp index 424e164e..af45f0bb 100644 --- a/server/encoder/flacEncoder.cpp +++ b/server/encoder/flacEncoder.cpp @@ -16,7 +16,6 @@ along with this program. If not, see . ***/ -#include #include #include "flacEncoder.h" @@ -139,9 +138,9 @@ void FlacEncoder::initEncoder() int quality(2); try { - quality = boost::lexical_cast(codecOptions_); + quality = std::stoi(codecOptions_); } - catch(boost::bad_lexical_cast) + catch(...) { throw SnapException("Invalid codec option: \"" + codecOptions_ + "\""); } diff --git a/server/encoder/oggEncoder.cpp b/server/encoder/oggEncoder.cpp index f5c59fc1..69cbe6c1 100644 --- a/server/encoder/oggEncoder.cpp +++ b/server/encoder/oggEncoder.cpp @@ -16,7 +16,6 @@ along with this program. If not, see . ***/ -#include #include #include @@ -137,9 +136,9 @@ void OggEncoder::initEncoder() double quality = 1.0; try { - quality = boost::lexical_cast(qual); + quality = std::stod(qual); } - catch(boost::bad_lexical_cast) + catch(...) { throw SnapException("Invalid codec option: \"" + codecOptions_ + "\""); } diff --git a/server/json/jsonrpc.h b/server/json/jsonrpc.h index b46402e2..996dddd3 100644 --- a/server/json/jsonrpc.h +++ b/server/json/jsonrpc.h @@ -21,7 +21,6 @@ #include #include -#include #include "json.hpp" #include "jsonrpcException.h" @@ -63,25 +62,6 @@ public: return value; } -// bool isParam(size_t idx, const std::string& param); - -/* template - T getParam(size_t idx) - { - if (idx >= params.size()) - throw JsonInvalidParamsException(*this); - try - { - return boost::lexical_cast(params[idx]); - } - catch(...) - { - throw JsonInvalidParamsException(*this); - } - } - - bool isParam(size_t idx, const std::string& param); -*/ protected: Json json_; diff --git a/server/streamSession.cpp b/server/streamSession.cpp index c8605c2a..e2992a60 100644 --- a/server/streamSession.cpp +++ b/server/streamSession.cpp @@ -18,7 +18,6 @@ #include "streamSession.h" -#include #include #include #include "common/log.h"