ADTF
|
Serves as component for string handling and conversion functionality. More...
Namespaces | |
unicode | |
Serves as component for unicode (UTF-8, UTF-16) string handling. | |
Classes | |
struct | ToNumericConverter |
Safe convenience string-to-numeric conversion methods for generic programming. More... | |
struct | IsNumericConvertible |
Convenience methods to validate string-to-numeric conversion for generic programming. More... | |
Functions | |
template<typename Numeric > | |
bool | toNumeric (const char *from, Numeric &to) |
Safely convert a string to a value of type Numeric in a generic manner. More... | |
template<typename Numeric > | |
bool | toNumeric (const std::string &from, Numeric &to) |
Safely convert a string to a value of type Numeric in a generic manner. More... | |
template<typename Numeric > | |
Numeric | toNumeric (const char *from) |
Convert a string to a numeric value in a generic manner. More... | |
template<typename Numeric > | |
Numeric | toNumeric (const std::string &from) |
Convert a string to a numeric value in a generic manner. More... | |
template<typename Numeric > | |
bool | isNumeric (const char *str) |
Check whether a string is convertible to a value of type Numeric for generic programming. More... | |
template<typename Numeric > | |
bool | isNumeric (const std::string &str) |
Check whether a string is convertible to a value of type Numeric for generic programming. More... | |
bool | toBool (const std::string &from, bool &to) |
Safely convert a string to a boolean value. More... | |
bool | toInt8 (const std::string &from, std::int8_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt16 (const std::string &from, std::int16_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt32 (const std::string &from, std::int32_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt64 (const std::string &from, std::int64_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt8 (const std::string &from, std::uint8_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt16 (const std::string &from, std::uint16_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt32 (const std::string &from, std::uint32_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt64 (const std::string &from, std::uint64_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toFloat (const std::string &from, float &to) |
Safely convert a string to a numeric value. More... | |
bool | toDouble (const std::string &from, double &to) |
Safely convert a string to a numeric value. More... | |
bool | toBool (const char *from, bool &to) |
Safely convert a string to a boolean value. More... | |
bool | toInt8 (const char *from, std::int8_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt16 (const char *from, std::int16_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt32 (const char *from, std::int32_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toInt64 (const char *from, std::int64_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt8 (const char *from, std::uint8_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt16 (const char *from, std::uint16_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt32 (const char *from, std::uint32_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toUInt64 (const char *from, std::uint64_t &to) |
Safely convert a string to a numeric value. More... | |
bool | toFloat (const char *from, float &to) |
Safely convert a string to a numeric value. More... | |
bool | toDouble (const char *from, double &to) |
Safely convert a string to a numeric value. More... | |
bool | toBool (const std::string &from) |
Convert a string to a boolean value. More... | |
std::int8_t | toInt8 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::int16_t | toInt16 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::int32_t | toInt32 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::int64_t | toInt64 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::uint8_t | toUInt8 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::uint16_t | toUInt16 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::uint32_t | toUInt32 (const std::string &from) |
Convert a string to a numeric value. More... | |
std::uint64_t | toUInt64 (const std::string &from) |
Convert a string to a numeric value. More... | |
float | toFloat (const std::string &from) |
Convert a string to a numeric value. More... | |
double | toDouble (const std::string &from) |
Convert a string to a numeric value. More... | |
bool | toBool (const char *from) |
Convert a string to a boolean value. More... | |
std::int8_t | toInt8 (const char *from) |
Convert a string to a numeric value. More... | |
std::int16_t | toInt16 (const char *from) |
Convert a string to a numeric value. More... | |
std::int32_t | toInt32 (const char *from) |
Convert a string to a numeric value. More... | |
std::int64_t | toInt64 (const char *from) |
Convert a string to a numeric value. More... | |
std::uint8_t | toUInt8 (const char *from) |
Convert a string to a numeric value. More... | |
std::uint16_t | toUInt16 (const char *from) |
Convert a string to a numeric value. More... | |
std::uint32_t | toUInt32 (const char *from) |
Convert a string to a numeric value. More... | |
std::uint64_t | toUInt64 (const char *from) |
Convert a string to a numeric value. More... | |
float | toFloat (const char *from) |
Convert a string to a numeric value. More... | |
double | toDouble (const char *from) |
Convert a string to a numeric value. More... | |
std::string | format (const char *str_format,...) |
printf()-like formatting of an input string. More... | |
std::string | format (std::size_t initial_buffer_size, const char *str_format,...) |
printf()-like formatting of an input string with a given destination string buffer size. More... | |
std::string & | format (std::string &buffer, std::size_t &pos, const char *str_format,...) |
printf()-like formatting of an input string with a given destination string buffer. More... | |
std::string | toString (bool from) |
Convert the boolean value to its string representation. More... | |
std::string | toString (std::int8_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::int16_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::int32_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::int64_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::uint8_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::uint16_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::uint32_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (std::uint64_t from) |
Convert the given value to a standard string. More... | |
std::string | toString (float from) |
Convert the given value to a standard string. More... | |
std::string | toString (double from) |
Convert the given value to a standard string. More... | |
int | compare (const char *left, const char *right) |
Compares two 0-terminated C-strings. More... | |
int | compare (const char *left, const char *right, std::size_t pos) |
Compares two 0-terminated C-strings. More... | |
int | compare (const char *left, const char *right, std::size_t pos, std::size_t length) |
Compares two 0-terminated C-strings. More... | |
int | compareNoCase (const char *left, const char *right) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp. More... | |
int | compareNoCase (const char *left, const char *right, std::size_t pos) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp. More... | |
int | compareNoCase (const char *left, const char *right, std::size_t pos, std::size_t length) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp. More... | |
bool | isEqual (const char *left, const char *right) |
Compares two 0-terminated C-strings for equality. More... | |
bool | isEqual (const char *left, const char *right, std::size_t pos) |
Compares two 0-terminated C-strings for equality. More... | |
bool | isEqual (const char *left, const char *right, std::size_t pos, std::size_t length) |
Compares two 0-terminated C-strings for equality. More... | |
bool | isEqualNoCase (const char *left, const char *right) |
Compares two 0-terminated C-strings for equality ignoring their case. More... | |
bool | isEqualNoCase (const char *left, const char *right, std::size_t pos) |
Compares two 0-terminated C-strings for equality ignoring their case. More... | |
bool | isEqualNoCase (const char *left, const char *right, std::size_t pos, std::size_t length) |
Compares two 0-terminated C-strings for equality ignoring their case. More... | |
std::size_t | getLength (const char *str) |
Counts the number of characters in a 0-terminated C-string. More... | |
std::size_t | copy (char *dest, std::size_t dest_size, const char *source) |
Copies up to dest_size-1 characters from source to dest, ensuring null termination. More... | |
std::size_t | copy (char *dest, std::size_t dest_size, const char *source, std::size_t count) |
Copies up to count characters from source to dest, ensuring null termination. More... | |
std::vector< std::string > | split (const std::string &str, const std::string &separator) |
Splits a string using a specified separator string. More... | |
std::vector< std::string > | split (const std::string &str, const std::string &separator, bool keep_empty) |
Splits a string using a specified separator string. More... | |
std::vector< std::string > | splitToken (const std::string &str) |
Splits a string on whitespace characters. More... | |
std::vector< std::string > | splitToken (const std::string &str, const std::string &separators) |
Splits a string using a set of separator characters. More... | |
std::vector< std::string > | splitToken (const std::string &str, const std::string &separators, bool keep_empty) |
Splits a string using a set of separator characters. More... | |
std::string & | trim (std::string &str) |
Trims all whitespace characters from the start and end of a string. More... | |
std::string & | trim (std::string &str, const std::string &trimmed_chars) |
Trims a specified set of characters from the start and end of a string. More... | |
bool | isEmpty (const char *str) |
Checks whether a C-style string is empty, meaning nullptr or "". More... | |
bool | isNotEmpty (const char *str) |
Checks whether a C-style string is not empty, meaning neither nullptr nor "". More... | |
std::string & | replace (std::string &str, const std::string &subject, const std::string &replacement) |
In-place replacement of all occurences of subject with replacement . More... | |
std::string | replace (const std::string &str, const std::string &subject, const std::string &replacement) |
Replace all occurences of subject with replacement . More... | |
std::string | join (const std::vector< std::string > &strings, const std::string &delimiter) |
Joins all strings from the vector into one string, separated by the specified delimiter string. More... | |
bool | isBool (const std::string &str) |
Check whether a string can be converted to a boolean type. More... | |
bool | isInt8 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt16 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt32 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt64 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt8 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt16 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt32 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt64 (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isFloat (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isDouble (const std::string &str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isBool (const char *str) |
Check whether a string can be converted to a boolean type. More... | |
bool | isInt8 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt16 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt32 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isInt64 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt8 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt16 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt32 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isUInt64 (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isFloat (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
bool | isDouble (const char *str) |
Check whether a string can be converted to a value of the given numeric type. More... | |
Variables | |
const std::string | white_space |
Contains all whitespaces (" \t\n\r") | |
const std::string | empty_string |
Contains the empty string. | |
Serves as component for string handling and conversion functionality.
int a_util::strings::compare | ( | const char * | left, |
const char * | right | ||
) |
Compares two 0-terminated C-strings.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
nullptr
, or > 0 if the left string is greater than the right string or a nullptr
. Referenced by ddl::access_element::findArrayEndIndex().
int a_util::strings::compare | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos | ||
) |
Compares two 0-terminated C-strings.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
nullptr
, or > 0 if the left string is greater than the right string or a nullptr
. int a_util::strings::compare | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos, | ||
std::size_t | length | ||
) |
Compares two 0-terminated C-strings.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
length | [in] Compare only length characters |
nullptr
, or > 0 if the left string is greater than the right string or a nullptr
. int a_util::strings::compareNoCase | ( | const char * | left, |
const char * | right | ||
) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp.
The generic-text function _tcsicmp, maps to either _stricmp, _wcsicmp, _mbsicmp depending on the character set that is defined at compile time. Each of these functions performs a case-insensitive comparison of the strings, and is not affected by locale.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
nullptr
, or > 0 if the left string is greater the right string (ignoring case) or a nullptr
. int a_util::strings::compareNoCase | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos | ||
) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp.
The generic-text function _tcsicmp, maps to either _stricmp, _wcsicmp, _mbsicmp depending on the character set that is defined at compile time. Each of these functions performs a case-insensitive comparison of the strings, and is not affected by locale.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
nullptr
, or > 0 if the left string is greater the right string (ignoring case) or a nullptr
. int a_util::strings::compareNoCase | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos, | ||
std::size_t | length | ||
) |
Compares two 0-terminated C-strings, ignoring the case using _tcsicmp.
The generic-text function _tcsicmp, maps to either _stricmp, _wcsicmp, _mbsicmp depending on the character set that is defined at compile time. Each of these functions performs a case-insensitive comparison of the strings, and is not affected by locale.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
length | [in] Compare only length characters |
nullptr
, or > 0 if the left string is greater the right string (ignoring case) or a nullptr
. std::size_t a_util::strings::copy | ( | char * | dest, |
std::size_t | dest_size, | ||
const char * | source | ||
) |
Copies up to dest_size-1 characters from source to dest, ensuring null termination.
dest | [in] Destination buffer |
dest_size | [in] Destination buffer size |
source | [in] Source string (0-terminated) |
std::size_t a_util::strings::copy | ( | char * | dest, |
std::size_t | dest_size, | ||
const char * | source, | ||
std::size_t | count | ||
) |
Copies up to count characters from source to dest, ensuring null termination.
dest | [in] Destination buffer |
dest_size | [in] Destination buffer size |
source | [in] Source string (0-terminated) |
count | [in] Maximum number of characters to copy |
std::string a_util::strings::format | ( | const char * | str_format, |
... | |||
) |
printf()-like formatting of an input string.
[in] | str_format | The formatting string. |
[in] | ... | vargs to create the formatted string from. |
std::string a_util::strings::format | ( | std::size_t | initial_buffer_size, |
const char * | str_format, | ||
... | |||
) |
printf()-like formatting of an input string with a given destination string buffer size.
[in] | initial_buffer_size | Initial allocyted size of the string buffer. Always pass size +1 for terminating 0-character. |
[in] | str_format | The formatting string. |
[in] | ... | vargs to create the formatted string from. |
std::string& a_util::strings::format | ( | std::string & | buffer, |
std::size_t & | pos, | ||
const char * | str_format, | ||
... | |||
) |
printf()-like formatting of an input string with a given destination string buffer.
[in,out] | buffer | Destination buffer for the formatted string. |
[in,out] | pos | Starting position in the buffer where the formatted string gets written to. After successful execution, gets set to the position of the last written character in the buffer . |
[in] | str_format | The formatting string. |
[in] | ... | vargs to create the formatted string from. |
buffer
). std::size_t a_util::strings::getLength | ( | const char * | str | ) |
Counts the number of characters in a 0-terminated C-string.
str | [in] The C-string |
nullptr
bool a_util::strings::isBool | ( | const char * | str | ) |
Check whether a string can be converted to a boolean type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isBool | ( | const std::string & | str | ) |
Check whether a string can be converted to a boolean type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isDouble | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isDouble | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isEmpty | ( | const char * | str | ) |
Checks whether a C-style string is empty, meaning nullptr or "".
[in] | str | C-style string to check - must either be nullptr or 0-terminated |
bool a_util::strings::isEqual | ( | const char * | left, |
const char * | right | ||
) |
Compares two 0-terminated C-strings for equality.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
bool a_util::strings::isEqual | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos | ||
) |
Compares two 0-terminated C-strings for equality.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
bool a_util::strings::isEqual | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos, | ||
std::size_t | length | ||
) |
Compares two 0-terminated C-strings for equality.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
length | [in] Compare only length characters |
bool a_util::strings::isEqualNoCase | ( | const char * | left, |
const char * | right | ||
) |
Compares two 0-terminated C-strings for equality ignoring their case.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
bool a_util::strings::isEqualNoCase | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos | ||
) |
Compares two 0-terminated C-strings for equality ignoring their case.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
bool a_util::strings::isEqualNoCase | ( | const char * | left, |
const char * | right, | ||
std::size_t | pos, | ||
std::size_t | length | ||
) |
Compares two 0-terminated C-strings for equality ignoring their case.
left | [in] The left string in the comparison |
right | [in] The right string in the comparison |
pos | [in] Compare from position pos |
length | [in] Compare only length characters |
bool a_util::strings::isFloat | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isFloat | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt16 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt16 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt32 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt32 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt64 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt64 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt8 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isInt8 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isNotEmpty | ( | const char * | str | ) |
Checks whether a C-style string is not empty, meaning neither nullptr nor "".
[in] | str | C-style string to check - must either be nullptr or 0-terminated |
!isEmpty
(str) bool isNumeric | ( | const char * | str | ) |
Check whether a string is convertible to a value of type Numeric
for generic programming.
Numeric | The numeric type. |
[in] | str | The string to check. |
true
if valid numeric value, false
otherwise. Definition at line 23 of file strings_numeric_traits_impl.h.
References IsNumericConvertible::check().
bool isNumeric | ( | const std::string & | str | ) |
Check whether a string is convertible to a value of type Numeric
for generic programming.
Numeric | The numeric type. |
[in] | str | The string to check. |
true
if valid numeric value, false
otherwise. Definition at line 29 of file strings_numeric_traits_impl.h.
bool a_util::strings::isUInt16 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt16 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt32 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt32 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt64 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt64 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt8 | ( | const char * | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. bool a_util::strings::isUInt8 | ( | const std::string & | str | ) |
Check whether a string can be converted to a value of the given numeric type.
[in] | str | The string to check. |
true
if the string can be converted, false
otherwise. std::string a_util::strings::join | ( | const std::vector< std::string > & | strings, |
const std::string & | delimiter | ||
) |
Joins all strings from the vector into one string, separated by the specified delimiter string.
[in] | strings | The vector of strings |
[in] | delimiter | The delimiter string |
std::string a_util::strings::replace | ( | const std::string & | str, |
const std::string & | subject, | ||
const std::string & | replacement | ||
) |
Replace all occurences of subject
with replacement
.
[in] | str | The string |
[in] | subject | The subject string to search for |
[in] | replacement | The replacement string to substitute |
std::string& a_util::strings::replace | ( | std::string & | str, |
const std::string & | subject, | ||
const std::string & | replacement | ||
) |
In-place replacement of all occurences of subject
with replacement
.
[in,out] | str | The string |
[in] | subject | The subject string to search for |
[in] | replacement | The replacement string to substitute |
str
, after replacement std::vector<std::string> a_util::strings::split | ( | const std::string & | str, |
const std::string & | separator | ||
) |
Splits a string using a specified separator string.
str | [in] The string |
separator | [in] The separator string |
std::vector<std::string> a_util::strings::split | ( | const std::string & | str, |
const std::string & | separator, | ||
bool | keep_empty | ||
) |
Splits a string using a specified separator string.
str | [in] The string |
separator | [in] The separator string |
keep_empty | [in] Flag whether to keep empty parts in the result vector |
std::vector<std::string> a_util::strings::splitToken | ( | const std::string & | str | ) |
Splits a string on whitespace characters.
str | [in] The string |
std::vector<std::string> a_util::strings::splitToken | ( | const std::string & | str, |
const std::string & | separators | ||
) |
Splits a string using a set of separator characters.
str | [in] The string |
separators | [in] The set of separator characters |
std::vector<std::string> a_util::strings::splitToken | ( | const std::string & | str, |
const std::string & | separators, | ||
bool | keep_empty | ||
) |
Splits a string using a set of separator characters.
str | [in] The string |
separators | [in] The set of separator characters |
keep_empty | [in] Flag whether to keep empty parts in the result vector |
bool a_util::strings::toBool | ( | const char * | from | ) |
Convert a string to a boolean value.
[in] | from | String to convert. If either "true" or "false" (case insensitive), evaluates to the corresponding boolean value. If numeric, implicit conversion rules apply. |
bool a_util::strings::toBool | ( | const char * | from, |
bool & | to | ||
) |
Safely convert a string to a boolean value.
[in] | from | String to convert. If either "true" or "false" (case insensitive), evaluates to the corresponding boolean value. If numeric, implicit conversion rules apply. |
[out] | to | Boolean value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
bool a_util::strings::toBool | ( | const std::string & | from | ) |
Convert a string to a boolean value.
[in] | from | String to convert. If either "true" or "false" (case insensitive), evaluates to the corresponding boolean value. If numeric, implicit conversion rules apply. |
bool a_util::strings::toBool | ( | const std::string & | from, |
bool & | to | ||
) |
Safely convert a string to a boolean value.
[in] | from | String to convert. If either "true" or "false" (case insensitive), evaluates to the corresponding boolean value. If numeric, implicit conversion rules apply. |
[out] | to | Boolean value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
double a_util::strings::toDouble | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toDouble | ( | const char * | from, |
double & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
double a_util::strings::toDouble | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toDouble | ( | const std::string & | from, |
double & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
float a_util::strings::toFloat | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toFloat | ( | const char * | from, |
float & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
float a_util::strings::toFloat | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toFloat | ( | const std::string & | from, |
float & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int16_t a_util::strings::toInt16 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt16 | ( | const char * | from, |
std::int16_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int16_t a_util::strings::toInt16 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt16 | ( | const std::string & | from, |
std::int16_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int32_t a_util::strings::toInt32 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt32 | ( | const char * | from, |
std::int32_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int32_t a_util::strings::toInt32 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt32 | ( | const std::string & | from, |
std::int32_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int64_t a_util::strings::toInt64 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt64 | ( | const char * | from, |
std::int64_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int64_t a_util::strings::toInt64 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt64 | ( | const std::string & | from, |
std::int64_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int8_t a_util::strings::toInt8 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt8 | ( | const char * | from, |
std::int8_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::int8_t a_util::strings::toInt8 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toInt8 | ( | const std::string & | from, |
std::int8_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
Numeric toNumeric | ( | const char * | from | ) |
Convert a string to a numeric value in a generic manner.
Numeric | The numeric type the string gets converted to. |
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
Definition at line 35 of file strings_convert_impl.h.
References ToNumericConverter::convert().
bool toNumeric | ( | const char * | from, |
Numeric & | to | ||
) |
Safely convert a string to a value of type Numeric
in a generic manner.
Numeric | The numeric type the string gets converted to. |
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
Definition at line 23 of file strings_convert_impl.h.
References ToNumericConverter::convert().
Numeric toNumeric | ( | const std::string & | from | ) |
Convert a string to a numeric value in a generic manner.
Numeric | The numeric type the string gets converted to. |
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
Definition at line 43 of file strings_convert_impl.h.
References ToNumericConverter::convert().
bool toNumeric | ( | const std::string & | from, |
Numeric & | to | ||
) |
Safely convert a string to a value of type Numeric
in a generic manner.
Numeric | The numeric type the string gets converted to. |
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
Definition at line 29 of file strings_convert_impl.h.
References ToNumericConverter::convert().
std::string a_util::strings::toString | ( | bool | from | ) |
Convert the boolean value to its string representation.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | double | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | float | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::int16_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::int32_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::int64_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::int8_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::uint16_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::uint32_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::uint64_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::string a_util::strings::toString | ( | std::uint8_t | from | ) |
Convert the given value to a standard string.
[in] | from | The value converted to its string representation. |
std::uint16_t a_util::strings::toUInt16 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt16 | ( | const char * | from, |
std::uint16_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint16_t a_util::strings::toUInt16 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt16 | ( | const std::string & | from, |
std::uint16_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint32_t a_util::strings::toUInt32 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt32 | ( | const char * | from, |
std::uint32_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint32_t a_util::strings::toUInt32 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt32 | ( | const std::string & | from, |
std::uint32_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint64_t a_util::strings::toUInt64 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt64 | ( | const char * | from, |
std::uint64_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint64_t a_util::strings::toUInt64 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt64 | ( | const std::string & | from, |
std::uint64_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint8_t a_util::strings::toUInt8 | ( | const char * | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt8 | ( | const char * | from, |
std::uint8_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::uint8_t a_util::strings::toUInt8 | ( | const std::string & | from | ) |
Convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of the return type numeric limits, the conversion fails. |
bool a_util::strings::toUInt8 | ( | const std::string & | from, |
std::uint8_t & | to | ||
) |
Safely convert a string to a numeric value.
[in] | from | String to convert. If the potentially convertible numeric value is not in range of decltype(to) numeric limits, the conversion fails. |
[out] | to | Numeric value converted from the string representation. |
true | Conversion was successful, to contains the converted value. |
false | Conversion failed, to is left untouched. |
std::string& a_util::strings::trim | ( | std::string & | str | ) |
Trims all whitespace characters from the start and end of a string.
str | [inout] The string that is trimmed |
std::string& a_util::strings::trim | ( | std::string & | str, |
const std::string & | trimmed_chars | ||
) |
Trims a specified set of characters from the start and end of a string.
str | [inout] The string that is trimmed |
trimmed_chars | [in] The set of characters to trim |