diff options
Diffstat (limited to 'host/lib/usrp/subdev_spec.cpp')
-rw-r--r-- | host/lib/usrp/subdev_spec.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp index 95d2cbb12..51c88bda3 100644 --- a/host/lib/usrp/subdev_spec.cpp +++ b/host/lib/usrp/subdev_spec.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -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; |