From 771b5cebda250f2a6a65aa7788e9051c94974c2b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 6 Jan 2011 15:38:56 -0800 Subject: uhd: integrated boost split or tokenizer into source files, remove string split from algorithms header --- host/lib/usrp/subdev_spec.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/subdev_spec.cpp') 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 -#include +#include //for split +#include #include #include #include #include +#include using namespace uhd; using namespace uhd::usrp; +#define pair_tokenizer(inp) \ + boost::tokenizer > \ + (inp, boost::char_separator(" ")) + 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 db_sd = std::split_string(pair, ":"); + std::vector 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; -- cgit v1.2.3