mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-19 17:37:45 +02:00
removed depency to boost lexical cast and boost algorithm
This commit is contained in:
parent
c8e58f272f
commit
84f9dd2d7a
7 changed files with 26 additions and 8 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue