ArmNN
 24.02
StringUtils.hpp File Reference
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <armnn/Exceptions.hpp>
Include dependency graph for StringUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 armnn
 Copyright (c) 2021 ARM Limited and Contributors.
 
 armnn::stringUtils
 

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="\t\n\v\f\r ")
 Trim from the start of a string. More...
 
std::string & StringEndTrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 Trim for the end of a string. More...
 
std::string & StringTrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 Trim from both the start and the end of a string. More...
 
std::string StringTrimCopy (const std::string &str, const std::string &chars="\t\n\v\f\r ")
 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...
 
bool StringToBool (const std::string &s, bool throw_on_error=true)
 Converts a string to bool. More...