|
template<typename... Args> |
static constexpr std::string | Format (std::string_view format, Args &&... args) |
| Get a formatted string similar to sprintf.
|
|
template<typename... Args> |
static constexpr std::wstring | Format (std::wstring_view format, Args &&... args) |
|
static std::string | FormatV (PRINTF_FORMAT_STRING const char *fmt, va_list args) |
|
static std::wstring | FormatV (PRINTF_FORMAT_STRING const wchar_t *fmt, va_list args) |
|
static std::string | ToUpper (const std::string &str) |
|
static std::wstring | ToUpper (const std::wstring &str) |
|
static void | ToUpper (std::string &str) |
|
static void | ToUpper (std::wstring &str) |
|
static std::string | ToLower (const std::string &str) |
|
static std::wstring | ToLower (const std::wstring &str) |
|
static void | ToLower (std::string &str) |
|
static void | ToLower (std::wstring &str) |
|
static void | ToCapitalize (std::string &str) |
|
static void | ToCapitalize (std::wstring &str) |
|
static bool | EqualsNoCase (const std::string &str1, const std::string &str2) |
|
static bool | EqualsNoCase (const std::string &str1, const char *s2) |
|
static bool | EqualsNoCase (const char *s1, const char *s2) |
|
static int | CompareNoCase (const std::string &str1, const std::string &str2, size_t n=0) |
|
static int | CompareNoCase (const char *s1, const char *s2, size_t n=0) |
|
static int | ReturnDigits (const std::string &str) |
|
static std::string | Left (const std::string &str, size_t count) |
|
static std::string | Mid (const std::string &str, size_t first, size_t count=std::string::npos) |
|
static std::string | Right (const std::string &str, size_t count) |
|
static std::string & | Trim (std::string &str) |
|
static std::string & | Trim (std::string &str, const char *const chars) |
|
static std::string & | TrimLeft (std::string &str) |
|
static std::string & | TrimLeft (std::string &str, const char *const chars) |
|
static std::string & | TrimRight (std::string &str) |
|
static std::string & | TrimRight (std::string &str, const char *const chars) |
|
static std::string & | RemoveDuplicatedSpacesAndTabs (std::string &str) |
|
static bool | IsSpecialCharacter (char c) |
| Check if the character is a special character.
|
|
static std::string | ReplaceSpecialCharactersWithSpace (const std::string &str) |
|
static int | Replace (std::string &str, char oldChar, char newChar) |
|
static int | Replace (std::string &str, const std::string &oldStr, const std::string &newStr) |
|
static int | Replace (std::wstring &str, const std::wstring &oldStr, const std::wstring &newStr) |
|
static bool | StartsWith (const std::string &str1, const std::string &str2) |
|
static bool | StartsWith (const std::string &str1, const char *s2) |
|
static bool | StartsWith (const char *s1, const char *s2) |
|
static bool | StartsWithNoCase (const std::string &str1, const std::string &str2) |
|
static bool | StartsWithNoCase (const std::string &str1, const char *s2) |
|
static bool | StartsWithNoCase (const char *s1, const char *s2) |
|
static bool | EndsWith (const std::string &str1, const std::string &str2) |
|
static bool | EndsWith (const std::string &str1, const char *s2) |
|
static bool | EndsWithNoCase (const std::string &str1, const std::string &str2) |
|
static bool | EndsWithNoCase (const std::string &str1, const char *s2) |
|
template<typename CONTAINER> |
static std::string | Join (const CONTAINER &strings, const std::string &delimiter) |
|
static std::vector< std::string > | Split (const std::string &input, const std::string &delimiter, unsigned int iMaxStrings=0) |
| Splits the given input string using the given delimiter into separate strings.
|
|
static std::vector< std::string > | Split (const std::string &input, const char delimiter, size_t iMaxStrings=0) |
|
static std::vector< std::string > | Split (const std::string &input, const std::vector< std::string > &delimiters) |
|
template<typename OutputIt> |
static OutputIt | SplitTo (OutputIt d_first, const std::string &input, const std::string &delimiter, unsigned int iMaxStrings=0) |
| Splits the given input string using the given delimiter into separate strings.
|
|
template<typename OutputIt> |
static OutputIt | SplitTo (OutputIt d_first, const std::string &input, const char delimiter, size_t iMaxStrings=0) |
|
template<typename OutputIt> |
static OutputIt | SplitTo (OutputIt d_first, const std::string &input, const std::vector< std::string > &delimiters) |
|
static std::vector< std::string > | SplitMulti (const std::vector< std::string > &input, const std::vector< std::string > &delimiters, size_t iMaxStrings=0) |
| Splits the given input strings using the given delimiters into further separate strings.
|
|
static int | FindNumber (const std::string &strInput, const std::string &strFind) |
|
static int64_t | AlphaNumericCompare (const wchar_t *left, const wchar_t *right) |
|
static int | AlphaNumericCollation (int nKey1, const void *pKey1, int nKey2, const void *pKey2) |
|
static long | TimeStringToSeconds (const std::string &timeString) |
|
static void | RemoveCRLF (std::string &strLine) |
|
static size_t | utf8_strlen (const char *s) |
| utf8 version of strlen - skips any non-starting bytes in the count, thus returning the number of utf8 characters
|
|
static std::string | SecondsToTimeString (long seconds, TIME_FORMAT format=TIME_FORMAT_GUESS) |
| convert a time in seconds to a string based on the given time format
|
|
static std::string | MillisecondsToTimeString (std::chrono::milliseconds milliSeconds) |
| convert a milliseconds value to a time string in the TIME_FORMAT_HH_MM_SS format
|
|
static bool | IsNaturalNumber (const std::string &str) |
| check whether a string is a natural number. Matches [ \t]*[0-9]+[ \t]*
|
|
static bool | IsInteger (const std::string &str) |
| check whether a string is an integer. Matches [ \t]*[-]*[0-9]+[ \t]*
|
|
static bool | isasciidigit (char chr) |
|
static bool | isasciixdigit (char chr) |
|
static int | asciidigitvalue (char chr) |
|
static int | asciixdigitvalue (char chr) |
|
static bool | isasciiuppercaseletter (char chr) |
|
static bool | isasciilowercaseletter (char chr) |
|
static bool | isasciialphanum (char chr) |
|
static std::string | SizeToString (int64_t size) |
|
static size_t | FindWords (const char *str, const char *wordLowerCase) |
|
static int | FindEndBracket (const std::string &str, char opener, char closer, int startPos=0) |
|
static int | DateStringToYYYYMMDD (const std::string &dateString) |
|
static std::string | ISODateToLocalizedDate (const std::string &strIsoDate) |
|
static void | WordToDigits (std::string &word) |
|
static std::string | CreateUUID () |
|
static bool | ValidateUUID (const std::string &uuid) |
|
static double | CompareFuzzy (const std::string &left, const std::string &right) |
|
static int | FindBestMatch (const std::string &str, const std::vector< std::string > &strings, double &matchscore) |
|
static bool | ContainsKeyword (const std::string &str, const std::vector< std::string > &keywords) |
|
static std::string | BinaryStringToString (const std::string &in) |
| Convert the string of binary chars to the actual string.
|
|
static std::string | ToHexadecimal (const std::string &in) |
|
template<typename T> |
static std::string | FormatNumber (T num) |
| Format the string with locale separators.
|
|
static std::string | Paramify (const std::string ¶m) |
| Escapes the given string to be able to be used as a parameter.
|
|
static std::string | DeParamify (const std::string ¶m) |
| Unescapes the given string.
|
|
static std::vector< std::string > | Tokenize (const std::string &input, const std::string &delimiters) |
| Split a string by the specified delimiters. Splits a string using one or more delimiting characters, ignoring empty tokens. Differs from Split() in two ways:
|
|
static void | Tokenize (const std::string &input, std::vector< std::string > &tokens, const std::string &delimiters) |
|
static std::vector< std::string > | Tokenize (const std::string &input, const char delimiter) |
|
static void | Tokenize (const std::string &input, std::vector< std::string > &tokens, const char delimiter) |
|
static uint32_t | ToUint32 (std::string_view str, uint32_t fallback=0) noexcept |
| Converts a string to a unsigned int number.
|
|
static uint64_t | ToUint64 (std::string_view str, uint64_t fallback=0) noexcept |
| Converts a string to a unsigned long long number.
|
|
static float | ToFloat (std::string_view str, float fallback=0.0f) noexcept |
| Converts a string to a float number.
|
|
static std::string | FormatFileSize (uint64_t bytes) |
|
static std::string | CreateFromCString (const char *cstr) |
| Converts a cstring pointer (const char*) to a std::string. In case nullptr is passed the result is an empty string.
|
|
static bool | Contains (std::string_view str, std::string_view keyword, bool isCaseInsensitive=true) |
| Check if a keyword string is contained on another string.
|
|