Concepts | |
concept | StdString |
Concept limiting the type to std::string and std::wstring, but also allowing convertible types like const char*. | |
Enumerations | |
enum | CaseSensitivity : uint8_t { RespectCase , IgnoreCase } |
Enum for case sensitive tasks. More... | |
Functions | |
static void | ltrim (std::string &s) |
Trim from start (in place) | |
static void | ltrim (std::string_view &sv) |
Trim from start (in place) | |
static std::string | ltrim_copy (std::string s) |
Trim from start (copying) | |
static std::string_view | ltrim_copy (std::string_view sv) |
Trim from start (copying) | |
static bool | replace (std::string &str, const std::string &from, const std::string &to, CaseSensitivity cs=RespectCase) |
Replaces the first occurrence of a search pattern with another sequence. | |
static void | replaceAll (std::string &str, const std::string &from, const std::string &to) |
Replaces all occurrence of a search pattern with another sequence. | |
static void | replaceAll (std::string &str, const std::string &from, const std::string &to, CaseSensitivity cs) |
Replaces all occurrence of a search pattern with another sequence. | |
static std::string | replaceAll_copy (std::string str, const std::string &from, const std::string &to) |
Replaces all occurrence of a search pattern with another sequence. | |
static std::string | replaceAll_copy (std::string str, const std::string &from, const std::string &to, CaseSensitivity cs) |
Replaces all occurrence of a search pattern with another sequence. | |
static void | rtrim (std::string &s) |
Trim from end (in place) | |
static void | rtrim (std::string_view &sv) |
Trim from end (in place) | |
static std::string | rtrim_copy (std::string s) |
Trim from end (copying) | |
static std::string_view | rtrim_copy (std::string_view sv) |
Trim from end (copying) | |
static std::vector< std::string > | split (const std::string &str, char delimiter) |
Splits a string into parts at a delimiter. | |
static std::vector< std::string > | split (const std::string &str, const std::string &delimiter) |
Splits a string into parts at a delimiter. | |
static std::vector< std::string > | split_wo_empty (const std::string &str, char delimiter) |
Splits a string into parts at a delimiter and removes empty entries. | |
static std::vector< std::string > | split_wo_empty (const std::string &str, const std::string &delimiter) |
Splits a string into parts at a delimiter and removes empty entries. | |
template<StdString String> | |
double | stod (const String &str, double default_value, std::size_t *pos=nullptr) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
float | stof (const String &str, float default_value, std::size_t *pos=nullptr) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
int | stoi (const String &str, int default_value, std::size_t *pos=nullptr, int base=10) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
int64_t | stol (const String &str, int64_t default_value, std::size_t *pos=nullptr, int base=10) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
long double | stold (const String &str, long double default_value, std::size_t *pos=nullptr) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
int64_t | stoll (const String &str, int64_t default_value, std::size_t *pos=nullptr, int base=10) noexcept |
Interprets a value in the string str. | |
template<StdString String> | |
uint64_t | stoul (const String &str, uint64_t default_value, std::size_t *pos=nullptr, int base=10) noexcept |
Interprets a value in the string str. | |
static void | trim (std::string &s) |
Trim from both ends (in place) | |
static void | trim (std::string_view &sv) |
Trim from both ends (in place) | |
static std::string | trim_copy (std::string s) |
Trim from both ends (copying) | |
static std::string_view | trim_copy (std::string_view sv) |
Trim from both ends (copying) | |
enum NAV::str::CaseSensitivity : uint8_t |
Enum for case sensitive tasks.
Enumerator | |
---|---|
RespectCase | Respect the case. |
IgnoreCase | Ignore case. |
Definition at line 137 of file StringUtil.hpp.
|
inlinestatic |
Trim from start (in place)
[in,out] | s | The string to trim |
Definition at line 28 of file StringUtil.hpp.
|
inlinestatic |
Trim from start (in place)
[in,out] | sv | The string view to trim |
Definition at line 62 of file StringUtil.hpp.
|
inlinestatic |
Trim from start (copying)
[in] | s | The string to trim |
Definition at line 85 of file StringUtil.hpp.
|
inlinestatic |
Trim from start (copying)
[in] | sv | The string view to trim |
Definition at line 112 of file StringUtil.hpp.
|
inlinestatic |
Replaces the first occurrence of a search pattern with another sequence.
[in,out] | str | String to search in and return value |
[in] | from | String pattern to search for |
[in] | to | Replacement string |
[in] | cs | Case sensitivity |
Definition at line 149 of file StringUtil.hpp.
|
inlinestatic |
Replaces all occurrence of a search pattern with another sequence.
[in,out] | str | String to search in and return value |
[in] | from | String pattern to search for |
[in] | to | Replacement string |
Definition at line 184 of file StringUtil.hpp.
|
inlinestatic |
Replaces all occurrence of a search pattern with another sequence.
[in,out] | str | String to search in and return value |
[in] | from | String pattern to search for |
[in] | to | Replacement string |
[in] | cs | Case sensitivity |
Definition at line 175 of file StringUtil.hpp.
|
inlinestatic |
Replaces all occurrence of a search pattern with another sequence.
[in,out] | str | String to search in and return value |
[in] | from | String pattern to search for |
[in] | to | Replacement string |
Definition at line 211 of file StringUtil.hpp.
|
inlinestatic |
Replaces all occurrence of a search pattern with another sequence.
[in,out] | str | String to search in and return value |
[in] | from | String pattern to search for |
[in] | to | Replacement string |
[in] | cs | Case sensitivity |
Definition at line 200 of file StringUtil.hpp.
|
inlinestatic |
Trim from end (in place)
[in,out] | s | The string to trim |
Definition at line 39 of file StringUtil.hpp.
|
inlinestatic |
Trim from end (in place)
[in,out] | sv | The string view to trim |
Definition at line 69 of file StringUtil.hpp.
|
inlinestatic |
Trim from end (copying)
[in] | s | The string to trim |
Definition at line 94 of file StringUtil.hpp.
|
inlinestatic |
Trim from end (copying)
[in] | sv | The string view to trim |
Definition at line 121 of file StringUtil.hpp.
|
inlinestatic |
Splits a string into parts at a delimiter.
[in] | str | String to split |
[in] | delimiter | Character to split at |
Definition at line 241 of file StringUtil.hpp.
|
inlinestatic |
Splits a string into parts at a delimiter.
[in] | str | String to split |
[in] | delimiter | Sequence of characters to split at |
Definition at line 221 of file StringUtil.hpp.
|
inlinestatic |
Splits a string into parts at a delimiter and removes empty entries.
[in] | str | String to split |
[in] | delimiter | Character to split at |
Definition at line 280 of file StringUtil.hpp.
|
inlinestatic |
Splits a string into parts at a delimiter and removes empty entries.
[in] | str | String to split |
[in] | delimiter | Sequence of characters to split at |
Definition at line 250 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
Definition at line 395 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
Definition at line 376 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
base | the number base |
Definition at line 297 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
base | the number base |
Definition at line 317 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
Definition at line 414 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
base | the number base |
Definition at line 357 of file StringUtil.hpp.
|
noexcept |
Interprets a value in the string str.
String | std::string or std::wstring and also allowing convertible types like const char* |
str | the string to convert |
default_value | default value to take if an invalid argument is given |
pos | address of an integer to store the number of characters processed |
base | the number base |
Definition at line 337 of file StringUtil.hpp.
|
inlinestatic |
Trim from both ends (in place)
[in,out] | s | The string to trim |
Definition at line 54 of file StringUtil.hpp.
|
inlinestatic |
Trim from both ends (in place)
[in,out] | sv | The string view to trim |
Definition at line 76 of file StringUtil.hpp.
|
inlinestatic |
Trim from both ends (copying)
[in] | s | The string to trim |
Definition at line 103 of file StringUtil.hpp.
|
inlinestatic |
Trim from both ends (copying)
[in] | sv | The string view to trim |
Definition at line 130 of file StringUtil.hpp.