From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/namespacearmnn_1_1string_utils.xhtml | 451 +++++++++++++++++++++++++++++ 1 file changed, 451 insertions(+) create mode 100644 21.02/namespacearmnn_1_1string_utils.xhtml (limited to '21.02/namespacearmnn_1_1string_utils.xhtml') diff --git a/21.02/namespacearmnn_1_1string_utils.xhtml b/21.02/namespacearmnn_1_1string_utils.xhtml new file mode 100644 index 0000000000..11afb95058 --- /dev/null +++ b/21.02/namespacearmnn_1_1string_utils.xhtml @@ -0,0 +1,451 @@ + + + + + + + + + + + + + +ArmNN: armnn::stringUtils Namespace Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
armnn::stringUtils Namespace Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Functions

std::vector< std::string > StringTokenizer (const std::string &str, const char *delimiters, bool tokenCompression=true)
 Function to take a string and a list of delimiters and split the string into tokens based on those delimiters This assumes that tokens are also to be split by newlines Enabling tokenCompression merges adjacent delimiters together, preventing empty tokens. More...
 
std::string & StringStartTrim (std::string &str, const std::string &chars="\\\")
 Trim from the start of a string. More...
 
std::string & StringEndTrim (std::string &str, const std::string &chars="\\\")
 Trim for the end of a string. More...
 
std::string & StringTrim (std::string &str, const std::string &chars="\\\")
 Trim from both the start and the end of a string. More...
 
std::string StringTrimCopy (const std::string &str, const std::string &chars="\\\")
 Trim from both the start and the end of a string, returns a trimmed copy of the string. More...
 
std::string StringConcat (const std::vector< std::string > &strings, std::string seperator="")
 Takes a vector of strings and concatenates them together into one long std::string with an optional seperator between each. More...
 
void StringReplaceAll (std::string &str, const std::string &oldStr, const std::string &newStr)
 Iterates over a given str and replaces all instance of substring oldStr with newStr. More...
 
+

Function Documentation

+ +

◆ StringConcat()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string armnn::stringUtils::StringConcat (const std::vector< std::string > & strings,
std::string seperator = "" 
)
+
+inline
+
+ +

Takes a vector of strings and concatenates them together into one long std::string with an optional seperator between each.

+ +

Definition at line 93 of file StringUtils.hpp.

+
94 {
95  std::stringstream ss;
96  for (auto string : strings)
97  {
98  ss << string << seperator;
99  }
100  return ss.str();
101 }
+
+
+ +

◆ StringEndTrim()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string& armnn::stringUtils::StringEndTrim (std::string & str,
const std::string & chars = "\t\n\v\f\r " 
)
+
+inline
+
+ +

Trim for the end of a string.

+ +

Definition at line 68 of file StringUtils.hpp.

+ +

Referenced by StringTrim(), and StringTrimCopy().

+
69 {
70  str.erase(str.find_last_not_of(chars) + 1);
71  return str;
72 }
+
+
+ +

◆ StringReplaceAll()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void armnn::stringUtils::StringReplaceAll (std::string & str,
const std::string & oldStr,
const std::string & newStr 
)
+
+inline
+
+ +

Iterates over a given str and replaces all instance of substring oldStr with newStr.

+ +

Definition at line 106 of file StringUtils.hpp.

+
109 {
110  std::string::size_type pos = 0u;
111  while ((pos = str.find(oldStr, pos)) != std::string::npos)
112  {
113  str.replace(pos, oldStr.length(), newStr);
114  pos += newStr.length();
115  }
116 }
+
+
+ +

◆ StringStartTrim()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string& armnn::stringUtils::StringStartTrim (std::string & str,
const std::string & chars = "\t\n\v\f\r " 
)
+
+inline
+
+ +

Trim from the start of a string.

+ +

Definition at line 59 of file StringUtils.hpp.

+ +

Referenced by StringTrim(), and StringTrimCopy().

+
60 {
61  str.erase(0, str.find_first_not_of(chars));
62  return str;
63 }
+
+
+ +

◆ StringTokenizer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::vector<std::string> armnn::stringUtils::StringTokenizer (const std::string & str,
const char * delimiters,
bool tokenCompression = true 
)
+
+inline
+
+ +

Function to take a string and a list of delimiters and split the string into tokens based on those delimiters This assumes that tokens are also to be split by newlines Enabling tokenCompression merges adjacent delimiters together, preventing empty tokens.

+ +

Definition at line 20 of file StringUtils.hpp.

+ +

Referenced by DynamicBackendUtils::GetBackendPathsImpl(), armnnQuantizer::GetFileNameFromCsvRow(), and ParseArrayImpl().

+
23 {
24  std::stringstream stringStream(str);
25  std::string line;
26  std::vector<std::string> tokenVector;
27  while (std::getline(stringStream, line))
28  {
29  std::size_t prev = 0;
30  std::size_t pos;
31  while ((pos = line.find_first_of(delimiters, prev)) != std::string::npos)
32  {
33  // Ignore adjacent tokens
34  if (pos > prev)
35  {
36  tokenVector.push_back(line.substr(prev, pos - prev));
37  }
38  // Unless token compression is disabled
39  else if (!tokenCompression)
40  {
41  tokenVector.push_back(line.substr(prev, pos - prev));
42  }
43  prev = pos + 1;
44  }
45  if (prev < line.length())
46  {
47  tokenVector.push_back(line.substr(prev, std::string::npos));
48  }
49  }
50  return tokenVector;
51 }
+
+
+ +

◆ StringTrim()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string& armnn::stringUtils::StringTrim (std::string & str,
const std::string & chars = "\t\n\v\f\r " 
)
+
+inline
+
+ +

Trim from both the start and the end of a string.

+ +

Definition at line 77 of file StringUtils.hpp.

+ +

References StringEndTrim(), and StringStartTrim().

+ +

Referenced by ExtractMeasurements(), and armnnQuantizer::GetFileNameFromCsvRow().

+
78 {
79  return StringStartTrim(StringEndTrim(str, chars), chars);
80 }
std::string & StringEndTrim(std::string &str, const std::string &chars="\\\")
Trim for the end of a string.
Definition: StringUtils.hpp:68
+
std::string & StringStartTrim(std::string &str, const std::string &chars="\\\")
Trim from the start of a string.
Definition: StringUtils.hpp:59
+
+
+
+ +

◆ StringTrimCopy()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string armnn::stringUtils::StringTrimCopy (const std::string & str,
const std::string & chars = "\t\n\v\f\r " 
)
+
+inline
+
+ +

Trim from both the start and the end of a string, returns a trimmed copy of the string.

+ +

Definition at line 85 of file StringUtils.hpp.

+ +

References StringEndTrim(), and StringStartTrim().

+ +

Referenced by ProgramOptions::ParseOptions(), and ParseStringList().

+
86 {
87  std::string strCopy = str;
88  return StringStartTrim(StringEndTrim(strCopy, chars), chars);
89 }
std::string & StringEndTrim(std::string &str, const std::string &chars="\\\")
Trim for the end of a string.
Definition: StringUtils.hpp:68
+
std::string & StringStartTrim(std::string &str, const std::string &chars="\\\")
Trim from the start of a string.
Definition: StringUtils.hpp:59
+
+
+
+
+
+ + + + -- cgit v1.2.1