From a8837bfcf45136f178a9884b7c6f6449b3e6ed41 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Thu, 16 Apr 2020 10:01:56 +0100 Subject: IVGCVSW-4513 Remove boost/algorithm/string * * Removed split, classification, trim, string, join, contains * Added StringUtils.hpp to replace the removed Boost String functionality Signed-off-by: David Monahan Change-Id: I8aa938dc3942cb65c512cccb2c069da66aa24668 --- .../NetworkExecutionUtils.hpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp') diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp index 278ba1b46a..a922228689 100644 --- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp +++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp @@ -26,9 +26,6 @@ #include #include -#include -#include -#include #include #include @@ -53,17 +50,7 @@ std::vector ParseArrayImpl(std::istream& stream, TParseElementFunc parseEleme std::string line; while (std::getline(stream, line)) { - std::vector tokens; - try - { - // Coverity fix: boost::split() may throw an exception of type boost::bad_function_call. - boost::split(tokens, line, boost::algorithm::is_any_of(chars), boost::token_compress_on); - } - catch (const std::exception& e) - { - ARMNN_LOG(error) << "An error occurred when splitting tokens: " << e.what(); - continue; - } + std::vector tokens = armnn::stringUtils::StringTokenizer(line, chars); for (const std::string& token : tokens) { if (!token.empty()) // See https://stackoverflow.com/questions/10437406/ @@ -174,7 +161,8 @@ std::vector ParseArray(std::istream& stream) std::vector ParseStringList(const std::string & inputString, const char * delimiter) { std::stringstream stream(inputString); - return ParseArrayImpl(stream, [](const std::string& s) { return boost::trim_copy(s); }, delimiter); + return ParseArrayImpl(stream, [](const std::string& s) { + return armnn::stringUtils::StringTrimCopy(s); }, delimiter); } void RemoveDuplicateDevices(std::vector& computeDevices) @@ -559,8 +547,8 @@ int RunTest(const std::string& format, bool parseUnsupported = false, const std::shared_ptr& runtime = nullptr) { - std::string modelFormat = boost::trim_copy(format); - std::string modelPath = boost::trim_copy(path); + std::string modelFormat = armnn::stringUtils::StringTrimCopy(format); + std::string modelPath = armnn::stringUtils::StringTrimCopy(path); std::vector inputNamesVector = ParseStringList(inputNames, ","); std::vector inputTensorShapesVector = ParseStringList(inputTensorShapesStr, ":"); std::vector inputTensorDataFilePathsVector = ParseStringList( -- cgit v1.2.1