diff options
author | Josh Blum <josh@joshknows.com> | 2011-01-06 15:38:56 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-01-06 15:38:56 -0800 |
commit | 771b5cebda250f2a6a65aa7788e9051c94974c2b (patch) | |
tree | 78856934a0786b962d5acafde2eb3338ab5df582 /host/lib/types | |
parent | 3d02c07470e83edfa118c7ff36e793ffa883ceff (diff) | |
download | uhd-771b5cebda250f2a6a65aa7788e9051c94974c2b.tar.gz uhd-771b5cebda250f2a6a65aa7788e9051c94974c2b.tar.bz2 uhd-771b5cebda250f2a6a65aa7788e9051c94974c2b.zip |
uhd: integrated boost split or tokenizer into source files, remove string split from algorithms header
Diffstat (limited to 'host/lib/types')
-rw-r--r-- | host/lib/types/device_addr.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/host/lib/types/device_addr.cpp b/host/lib/types/device_addr.cpp index 4fdce097b..14afaa24b 100644 --- a/host/lib/types/device_addr.cpp +++ b/host/lib/types/device_addr.cpp @@ -32,19 +32,15 @@ static std::string trim(const std::string &in){ return boost::algorithm::trim_copy(in); } -static boost::tokenizer<boost::char_separator<char> > tokenize( - const std::string &input, const std::string &tok -){ - return boost::tokenizer<boost::char_separator<char> >( - input, boost::char_separator<char>(tok.c_str()) - ); -} +#define tokenizer(inp, sep) \ + boost::tokenizer<boost::char_separator<char> > \ + (inp, boost::char_separator<char>(sep.c_str())) device_addr_t::device_addr_t(const std::string &args){ - BOOST_FOREACH(const std::string &pair, tokenize(args, arg_delim)){ + BOOST_FOREACH(const std::string &pair, tokenizer(args, arg_delim)){ if (trim(pair) == "") continue; std::string key; - BOOST_FOREACH(const std::string &tok, tokenize(pair, pair_delim)){ + BOOST_FOREACH(const std::string &tok, tokenizer(pair, pair_delim)){ if (key.empty()) key = tok; else{ this->set(trim(key), trim(tok)); |