removed depency to boost lexical cast and boost algorithm

This commit is contained in:
badaix 2015-11-12 09:35:12 +01:00
parent c8e58f272f
commit 84f9dd2d7a
7 changed files with 26 additions and 8 deletions

View file

@ -18,11 +18,11 @@
#include <iostream>
#include <mutex>
#include "common/log.h"
#include "clientConnection.h"
#include "common/utils.h"
#include "common/snapException.h"
#include "message/hello.h"
#include "common/log.h"
using namespace std;

View file

@ -24,7 +24,6 @@
#include <iostream>
#include <cstring>
#include <sstream>
#include <boost/lexical_cast.hpp>
#define logD std::clog << kDbg
#define logO std::clog << kOut

View file

@ -26,6 +26,7 @@
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <iterator>
#include <sys/ioctl.h>
#include <net/if.h>
@ -79,6 +80,26 @@ static inline std::string trim_copy(const std::string &s)
}
static std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems)
{
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim))
{
elems.push_back(item);
}
return elems;
}
static std::vector<std::string> split(const std::string &s, char delim)
{
std::vector<std::string> elems;
split(s, delim, elems);
return elems;
}
static std::string getHostName()
{
char hostname[1024];

View file

@ -17,12 +17,12 @@
***/
#include <vector>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <sstream>
#include "sampleFormat.h"
#include "common/utils.h"
#include "common/log.h"
#include <sstream>
using namespace std;
@ -58,7 +58,7 @@ string SampleFormat::getFormat() const
void SampleFormat::setFormat(const std::string& format)
{
std::vector<std::string> strs;
boost::split(strs, format, boost::is_any_of(":"));
strs = split(format, ':');
if (strs.size() == 3)
setFormat(
std::stoul(strs[0]),

View file

@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "boost/lexical_cast.hpp"
#include "controlServer.h"
#include "message/time.h"
#include "message/ack.h"

View file

@ -20,9 +20,9 @@
#include <cstring>
#include "oggEncoder.h"
#include "common/log.h"
#include "common/snapException.h"
#include "common/utils.h"
#include "common/log.h"
using namespace std;

View file

@ -20,7 +20,6 @@
#define JSON_RPC_EXCEPTION_H
#include <string>
#include <boost/lexical_cast.hpp>
#include "json.hpp"
#include "common/snapException.h"