From: Marcin Siodelski Date: Mon, 21 May 2012 13:56:29 +0000 (+0200) Subject: [1954] Removed boost/tokenizer as it has unused parameters that crash build X-Git-Tag: trac2351_base~226^2~76^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6fb56baf17fbb2d8e666bfd7c16138f2a3ae5a44;p=thirdparty%2Fkea.git [1954] Removed boost/tokenizer as it has unused parameters that crash build --- diff --git a/tests/tools/perfdhcp/command_options.cc b/tests/tools/perfdhcp/command_options.cc index 09bc61e268..92332ccbe1 100644 --- a/tests/tools/perfdhcp/command_options.cc +++ b/tests/tools/perfdhcp/command_options.cc @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -365,26 +364,25 @@ CommandOptions::decodeBase(const std::string& base) { void CommandOptions::decodeMac(const std::string& base) { - typedef boost::tokenizer > tokenizer; - // Strip string from mac= size_t found = base.find('='); check(found == std::string::npos, "expected -b format for MAC address is -b MAC=00::0C::01::02::03::04"); - // Tokenize remaining part of the argument to get pieces of MAC address - boost::char_separator sep(":-"); - tokenizer tokens(base.substr(found + 1), sep); - std::vector stokens(tokens.begin(), tokens.end()); - check(stokens.size() != 6, "expected -b format for MAC address is -b MAC=00::0C::01::02::03::04"); + // Decode MAC address to vector of uint8_t + std::istringstream s1(base.substr(found+1)); + std::string token; mac_prefix_.resize(0); - BOOST_FOREACH(std::string t, stokens) { - std::istringstream ss(t); + while (std::getline(s1, token, ':')) { unsigned int ui = 0; - ss >> std::hex >> ui >> std::dec; - check(ss.fail() || (ui > 0xFF), - "expected -b format for MAC address is -b MAC=00::0C::01::02::03::04"); - mac_prefix_.push_back(static_cast(ui)); + std::istringstream s2(token); + if (token.length() > 0) { + s2 >> std::hex >> ui >> std::dec; + check(s2.fail() || (ui > 0xFF), + "expected -b format for MAC address is -b MAC=00::0C::01::02::03::04"); + mac_prefix_.push_back(ui); + } } + check(mac_prefix_.size() != 6, "expected -b format for MAC address is -b MAC=00::0C::01::02::03::04"); } void