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/utils/paths.cpp | |
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/utils/paths.cpp')
-rw-r--r-- | host/lib/utils/paths.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 9e9525caf..f2037a38d 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 <uhd/utils/algorithm.hpp> +#include <boost/tokenizer.hpp> #include <boost/program_options.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> @@ -38,6 +38,10 @@ namespace fs = boost::filesystem; static const std::string env_path_sep = ":"; #endif /*UHD_PLATFORM_WIN32*/ +#define path_tokenizer(inp) \ + boost::tokenizer<boost::char_separator<char> > \ + (inp, boost::char_separator<char>(env_path_sep.c_str())) + /*********************************************************************** * Get a list of paths for an environment variable **********************************************************************/ @@ -60,7 +64,7 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){ //convert to filesystem path, filter blank paths std::vector<fs::path> paths; - BOOST_FOREACH(const std::string &path_string, std::split_string(var_value, env_path_sep)){ + BOOST_FOREACH(const std::string &path_string, path_tokenizer(var_value)){ if (path_string.empty()) continue; paths.push_back(fs::system_complete(path_string)); } |