From 805d4a0cff00fb4e0071bb300436bb7eefb8fb16 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 12 Aug 2010 10:08:17 -0700 Subject: uhd: made split string utility function --- host/lib/usrp/usrp2/usrp2_impl.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'host/lib/usrp/usrp2') diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 21f411afe..45362c20f 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,12 +41,6 @@ static const size_t DISCOVERY_TIMEOUT_MS = 100; /*********************************************************************** * Helper Functions **********************************************************************/ -std::vector split_addrs(const std::string &addrs_str){ - std::vector addrs; - boost::split(addrs, addrs_str, boost::is_any_of("\t ")); - return addrs; -} - template std::string num2str(T num){ return boost::lexical_cast(num); } @@ -80,7 +74,7 @@ static uhd::device_addrs_t usrp2_find(const device_addr_t &hint){ } //if there are multiple addresses, just return good, dont test - std::vector addrs = split_addrs(hint["addr"]); + std::vector addrs = std::split_string(hint["addr"]); if (addrs.size() > 1){ device_addr_t new_addr; new_addr["type"] = "usrp2"; @@ -155,7 +149,7 @@ static device::sptr usrp2_make(const device_addr_t &device_addr){ std::vector ctrl_transports; std::vector data_transports; - BOOST_FOREACH(const std::string &addr, split_addrs(device_addr["addr"])){ + BOOST_FOREACH(const std::string &addr, std::split_string(device_addr["addr"])){ ctrl_transports.push_back(udp_simple::make_connected( addr, num2str(USRP2_UDP_CTRL_PORT) )); -- cgit v1.2.3