aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/subdev_spec.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-06 15:38:56 -0800
committerJosh Blum <josh@joshknows.com>2011-01-06 15:38:56 -0800
commit771b5cebda250f2a6a65aa7788e9051c94974c2b (patch)
tree78856934a0786b962d5acafde2eb3338ab5df582 /host/lib/usrp/subdev_spec.cpp
parent3d02c07470e83edfa118c7ff36e793ffa883ceff (diff)
downloaduhd-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/usrp/subdev_spec.cpp')
-rw-r--r--host/lib/usrp/subdev_spec.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp
index 95d2cbb12..c905eab7d 100644
--- a/host/lib/usrp/subdev_spec.cpp
+++ b/host/lib/usrp/subdev_spec.cpp
@@ -16,15 +16,21 @@
//
#include <uhd/usrp/subdev_spec.hpp>
-#include <uhd/utils/algorithm.hpp>
+#include <boost/algorithm/string.hpp> //for split
+#include <boost/tokenizer.hpp>
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include <stdexcept>
#include <sstream>
+#include <vector>
using namespace uhd;
using namespace uhd::usrp;
+#define pair_tokenizer(inp) \
+ boost::tokenizer<boost::char_separator<char> > \
+ (inp, boost::char_separator<char>(" "))
+
subdev_spec_pair_t::subdev_spec_pair_t(
const std::string &db_name, const std::string &sd_name
):
@@ -39,9 +45,9 @@ bool usrp::operator==(const subdev_spec_pair_t &lhs, const subdev_spec_pair_t &r
}
subdev_spec_t::subdev_spec_t(const std::string &markup){
- BOOST_FOREACH(const std::string &pair, std::split_string(markup)){
+ BOOST_FOREACH(const std::string &pair, pair_tokenizer(markup)){
if (pair == "") continue;
- std::vector<std::string> db_sd = std::split_string(pair, ":");
+ std::vector<std::string> db_sd; boost::split(db_sd, pair, boost::is_any_of(":"));
switch(db_sd.size()){
case 1: this->push_back(subdev_spec_pair_t("", db_sd.front())); break;
case 2: this->push_back(subdev_spec_pair_t(db_sd.front(), db_sd.back())); break;