diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-10-22 15:09:00 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-10-22 15:09:00 +0000 |
| commit | c6035b2e24410e7a576f83e92257f4bb26d593c9 (patch) | |
| tree | b6221953e8a95566aaeba33c527d70f810f51bed /src/ParameterizedStringParser.cc | |
| parent | 3349fe081156776aba058b90beebb68d4ee73e75 (diff) | |
2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved static functions in Util class to namespace util.
* src
* test
Diffstat (limited to 'src/ParameterizedStringParser.cc')
| -rw-r--r-- | src/ParameterizedStringParser.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ParameterizedStringParser.cc b/src/ParameterizedStringParser.cc index 74f81ce4..3752f1c6 100644 --- a/src/ParameterizedStringParser.cc +++ b/src/ParameterizedStringParser.cc @@ -91,8 +91,8 @@ PStringDatumHandle ParameterizedStringParser::createSelect(const std::string& sr throw DL_ABORT_EX("Missing '}' in the parameterized string."); } std::deque<std::string> values; - split(src.substr(offset, rightParenIndex-offset), std::back_inserter(values), - ",", true); + util::split(src.substr(offset, rightParenIndex-offset), + std::back_inserter(values), ",", true); if(values.empty()) { throw DL_ABORT_EX("Empty {} is not allowed."); } @@ -116,32 +116,32 @@ PStringDatumHandle ParameterizedStringParser::createLoop(const std::string& src, std::string::size_type colonIndex = loopStr.find(":"); if(colonIndex != std::string::npos) { std::string stepStr = loopStr.substr(colonIndex+1); - if(Util::isNumber(stepStr)) { - step = Util::parseUInt(stepStr); + if(util::isNumber(stepStr)) { + step = util::parseUInt(stepStr); } else { throw DL_ABORT_EX("A step count must be a positive number."); } loopStr.erase(colonIndex); } - std::pair<std::string, std::string> range = Util::split(loopStr, "-"); + std::pair<std::string, std::string> range = util::split(loopStr, "-"); if(range.first.empty() || range.second.empty()) { throw DL_ABORT_EX("Loop range missing."); } NumberDecoratorHandle nd; unsigned int start; unsigned int end; - if(Util::isNumber(range.first) && Util::isNumber(range.second)) { + if(util::isNumber(range.first) && util::isNumber(range.second)) { nd.reset(new FixedWidthNumberDecorator(range.first.size())); - start = Util::parseUInt(range.first); - end = Util::parseUInt(range.second); - } else if(Util::isLowercase(range.first) && Util::isLowercase(range.second)) { + start = util::parseUInt(range.first); + end = util::parseUInt(range.second); + } else if(util::isLowercase(range.first) && util::isLowercase(range.second)) { nd.reset(new AlphaNumberDecorator(range.first.size())); - start = Util::alphaToNum(range.first); - end = Util::alphaToNum(range.second); - } else if(Util::isUppercase(range.first) && Util::isUppercase(range.second)) { + start = util::alphaToNum(range.first); + end = util::alphaToNum(range.second); + } else if(util::isUppercase(range.first) && util::isUppercase(range.second)) { nd.reset(new AlphaNumberDecorator(range.first.size(), true)); - start = Util::alphaToNum(range.first); - end = Util::alphaToNum(range.second); + start = util::alphaToNum(range.first); + end = util::alphaToNum(range.second); } else { throw DL_ABORT_EX("Invalid loop range."); } |
