AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Functions | |
bool | endsWith (const std::string &str, const std::string &suffix) |
Tests whether a string ends with another string https://stackoverflow.com/questions/20446201/how-to-check-if-string-ends-with-txt/20446257. More... | |
bool | endsWith (const std::string &str, const char suffix) |
Tests whether a string ends with a char. More... | |
bool | startsWith (const std::string &str, const std::string &prefix) |
Tests whether a string starts with another string. More... | |
bool | startsWith (const std::string &str, const char prefix) |
Tests whether a string starts with a char. More... | |
std::string | removeSuffix (const std::string &str, const std::string &suffix) |
Removes suffix from the end of str, if present. More... | |
std::vector< std::string > | split (const std::string &str, const char delimiter) |
Splits the given string based on the given delimiter. More... | |
void | toLower (std::string &str) |
Converts a string to lowercase. More... | |
void | toUpper (std::string &str) |
Converts a string to uppercase. More... | |
std::vector< std::string > | rsplitN (const std::string &input, const std::size_t n, const char delim) |
Retrieves the last "n" tokens of a string split with the specified delimiter. More... | |
std::string | appendPrefix (const std::string &prefix, const std::string &name, const char delim='/') |
This function appends the prefix name to the ending name. More... | |
std::string | removePrefix (const std::string &prefix, const std::string &name, const char delim='/') |
This function returns the tail of a string following a given prefix plus a delimiter. More... | |
std::string | removeBeforeDelimiter (const std::string &str, const char delim='/') |
This function extracts the substring following the last instance of the delimiting character. More... | |
std::string | removeAllInstances (const std::string &target, const std::string &substr) |
This function removes all instances of the substring from the target string. More... | |
std::string | replaceAllInstances (const std::string &target, const std::string &findstr, const std::string &replacestr) |
This function finds all instances of a substring and replaces it with another string for the target string. More... | |
Variables | |
static const std::string | InvalidName |
An invalid name string used in axom components. More... | |
|
inline |
Tests whether a string ends with another string https://stackoverflow.com/questions/20446201/how-to-check-if-string-ends-with-txt/20446257.
[in] | str | string to be searched |
[in] | suffix | string to be checked for |
|
inline |
Tests whether a string ends with a char.
[in] | str | string to be searched |
[in] | suffix | char to be checked for |
|
inline |
Tests whether a string starts with another string.
[in] | str | string to be searched |
[in] | prefix | string to be checked for |
|
inline |
Tests whether a string starts with a char.
[in] | str | string to be searched |
[in] | prefix | char to be checked for |
|
inline |
Removes suffix from the end of str, if present.
[in] | str | string to be searched |
[in] | suffix | string to check for |
References endsWith().
std::vector<std::string> axom::utilities::string::split | ( | const std::string & | str, |
const char | delimiter | ||
) |
Splits the given string based on the given delimiter.
[in] | str | string to be tokenized |
[in] | delimiter | char to split string on |
void axom::utilities::string::toLower | ( | std::string & | str | ) |
Converts a string to lowercase.
[in,out] | str | string to be converted |
void axom::utilities::string::toUpper | ( | std::string & | str | ) |
Converts a string to uppercase.
[in,out] | str | string to be converted |
std::vector<std::string> axom::utilities::string::rsplitN | ( | const std::string & | input, |
const std::size_t | n, | ||
const char | delim | ||
) |
Retrieves the last "n" tokens of a string split with the specified delimiter.
[in] | input | The string to split |
[in] | n | The number of tokens to retrieve |
[in] | delim | The delimiter to split with |
Splits a string starting from the end of the string into a maximum of n tokens
std::string axom::utilities::string::appendPrefix | ( | const std::string & | prefix, |
const std::string & | name, | ||
const char | delim = '/' |
||
) |
This function appends the prefix name to the ending name.
[in] | prefix | The prefix string name. |
[in] | name | The ending string name. |
[in] | delim | The delimiting character inserted between the prefix and the name, if both are non-empty |
std::string axom::utilities::string::removePrefix | ( | const std::string & | prefix, |
const std::string & | name, | ||
const char | delim = '/' |
||
) |
This function returns the tail of a string following a given prefix plus a delimiter.
[in] | prefix | The prefix of the name, to be removed. |
[in] | name | The full name. |
[in] | delim | The delimiting character "expected" to separate the prefix and the return value |
For example, removePrefix("foo", "foo/bar") will return "bar". If the prefix is empty or not found the full name string is returned.
std::string axom::utilities::string::removeBeforeDelimiter | ( | const std::string & | str, |
const char | delim = '/' |
||
) |
This function extracts the substring following the last instance of the delimiting character.
[in] | str | The string to extract from |
[in] | delim | The delimiting character |
std::string axom::utilities::string::removeAllInstances | ( | const std::string & | target, |
const std::string & | substr | ||
) |
This function removes all instances of the substring from the target string.
[in] | target | The string to operate on |
[in] | substr | The string to remove |
std::string axom::utilities::string::replaceAllInstances | ( | const std::string & | target, |
const std::string & | findstr, | ||
const std::string & | replacestr | ||
) |
This function finds all instances of a substring and replaces it with another string for the target string.
[in] | target | The string to operate on |
[in] | findstr | The string to find |
[in] | replacestr | The string to replace with |
|
static |
An invalid name string used in axom components.
This is an empty string that is available for axom components to compare as an invalid name.