diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-15 10:55:18 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-15 10:55:18 -0700 |
commit | 45c952399b92d5dc618c469cf48c9980ee6f0e80 (patch) | |
tree | 077870c0975c97cabd5d8c76e19965aeade2cdc6 /host/lib/utils | |
parent | 9cb9e7d52255d3e14e57867eee76b555f705954c (diff) | |
parent | 98ba0cc067489d417342314a7e7408d2dbbc8250 (diff) | |
download | uhd-45c952399b92d5dc618c469cf48c9980ee6f0e80.tar.gz uhd-45c952399b92d5dc618c469cf48c9980ee6f0e80.tar.bz2 uhd-45c952399b92d5dc618c469cf48c9980ee6f0e80.zip |
Merge branch 'next' into usrp1
Diffstat (limited to 'host/lib/utils')
-rw-r--r-- | host/lib/utils/paths.cpp | 10 | ||||
-rw-r--r-- | host/lib/utils/props.cpp | 9 | ||||
-rw-r--r-- | host/lib/utils/warning.cpp | 8 |
3 files changed, 7 insertions, 20 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 4029bd989..9ac20d855 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -17,7 +17,7 @@ #include "constants.hpp" #include <uhd/config.hpp> -#include <boost/algorithm/string.hpp> +#include <uhd/utils/algorithm.hpp> #include <boost/program_options.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> @@ -58,15 +58,9 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){ po::store(po::parse_environment(desc, boost::bind(&name_mapper, var_name, _1)), vm); po::notify(vm); - //split the path at the path separators - std::vector<std::string> path_strings; - if (not var_value.empty()) boost::split(//dont split empty strings - path_strings, var_value, boost::is_any_of(env_path_sep) - ); - //convert to filesystem path, filter blank paths std::vector<fs::path> paths; - BOOST_FOREACH(std::string &path_string, path_strings){ + BOOST_FOREACH(const std::string &path_string, std::split_string(var_value, env_path_sep)){ if (path_string.empty()) continue; paths.push_back(fs::system_complete(path_string)); } diff --git a/host/lib/utils/props.cpp b/host/lib/utils/props.cpp index fac5fe24f..fc9f8e63f 100644 --- a/host/lib/utils/props.cpp +++ b/host/lib/utils/props.cpp @@ -29,15 +29,12 @@ named_prop_t::named_prop_t( /* NOP */ } -typedef boost::tuple<wax::obj, std::string> named_prop_tuple; - -named_prop_tuple uhd::extract_named_prop( +named_prop_t named_prop_t::extract( const wax::obj &key, const std::string &name ){ if (key.type() == typeid(named_prop_t)){ - named_prop_t np = key.as<named_prop_t>(); - return named_prop_tuple(np.key, np.name); + return key.as<named_prop_t>(); } - return named_prop_tuple(key, name); + return named_prop_t(key, name); } diff --git a/host/lib/utils/warning.cpp b/host/lib/utils/warning.cpp index ae4d4c7aa..8a7d35a23 100644 --- a/host/lib/utils/warning.cpp +++ b/host/lib/utils/warning.cpp @@ -16,7 +16,7 @@ // #include <uhd/utils/warning.hpp> -#include <boost/algorithm/string.hpp> +#include <uhd/utils/algorithm.hpp> #include <boost/foreach.hpp> #include <iostream> #include <vector> @@ -24,13 +24,9 @@ using namespace uhd; void uhd::print_warning(const std::string &msg){ - //extract the message lines - std::vector<std::string> lines; - boost::split(lines, msg, boost::is_any_of("\n")); - //print the warning message std::cerr << std::endl << "Warning:" << std::endl; - BOOST_FOREACH(const std::string &line, lines){ + BOOST_FOREACH(const std::string &line, std::split_string(msg, "\n")){ std::cerr << " " << line << std::endl; } } |