Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Check strings for the desired state
With this, texts can be checked to see that they correspond to a required format.
More...
Functions | |
static bool | kodi::tools::StringUtils::EqualsNoCase (const std::string &str1, const std::string &str2) |
Compare two strings with ignore of lower-/uppercase. | |
static bool | kodi::tools::StringUtils::EqualsNoCase (const std::string &str1, const char *s2) |
Compare two strings with ignore of lower-/uppercase. | |
static bool | kodi::tools::StringUtils::EqualsNoCase (const char *s1, const char *s2) |
Compare two strings with ignore of lower-/uppercase. | |
static int | kodi::tools::StringUtils::CompareNoCase (const std::string &str1, const std::string &str2, size_t n=0) |
Compare two strings with ignore of lower-/uppercase with given size. | |
static int | kodi::tools::StringUtils::CompareNoCase (const char *s1, const char *s2, size_t n=0) |
Compare two strings with ignore of lower-/uppercase with given size. | |
static bool | kodi::tools::StringUtils::StartsWith (const std::string &str1, const std::string &str2) |
Checks a string for the begin of another string. | |
static bool | kodi::tools::StringUtils::StartsWith (const std::string &str1, const char *s2) |
Checks a string for the begin of another string. | |
static bool | kodi::tools::StringUtils::StartsWith (const char *s1, const char *s2) |
Checks a string for the begin of another string. | |
static bool | kodi::tools::StringUtils::StartsWithNoCase (const std::string &str1, const std::string &str2) |
Checks a string for the begin of another string by ignore of upper-/lowercase. | |
static bool | kodi::tools::StringUtils::StartsWithNoCase (const std::string &str1, const char *s2) |
Checks a string for the begin of another string by ignore of upper-/lowercase. | |
static bool | kodi::tools::StringUtils::StartsWithNoCase (const char *s1, const char *s2) |
Checks a string for the begin of another string by ignore of upper-/lowercase. | |
static bool | kodi::tools::StringUtils::EndsWith (const std::string &str1, const std::string &str2) |
Checks a string for the ending of another string. | |
static bool | kodi::tools::StringUtils::EndsWith (const std::string &str1, const char *s2) |
Checks a string for the ending of another string. | |
static bool | kodi::tools::StringUtils::EndsWithNoCase (const std::string &str1, const std::string &str2) |
Checks a string for the ending of another string by ignore of upper-/lowercase. | |
static bool | kodi::tools::StringUtils::EndsWithNoCase (const std::string &str1, const char *s2) |
Checks a string for the ending of another string by ignore of upper-/lowercase. | |
static int64_t | kodi::tools::StringUtils::AlphaNumericCompare (const wchar_t *left, const wchar_t *right) |
Compare two strings by his calculated alpha numeric values. | |
static size_t | kodi::tools::StringUtils::Utf8StringLength (const char *s) |
UTF8 version of strlen. | |
static int | kodi::tools::StringUtils::IsSpace (char c) |
Check given character is a space. | |
static int | kodi::tools::StringUtils::IsUTF8Letter (const unsigned char *str) |
Checks given pointer in string is a UTF8 letter. | |
static bool | kodi::tools::StringUtils::IsNaturalNumber (const std::string &str) |
Check whether a string is a natural number. | |
static bool | kodi::tools::StringUtils::IsInteger (const std::string &str) |
Check whether a string is an integer. | |
static bool | kodi::tools::StringUtils::IsAasciiDigit (char chr) |
Checks a character is ascii number. | |
static bool | kodi::tools::StringUtils::IsAsciiXDigit (char chr) |
Checks a character is ascii hexadecimal number. | |
static int | kodi::tools::StringUtils::AsciiDigitValue (char chr) |
Translate a character where defined as a numerical value (0-9) string to right integer. | |
static int | kodi::tools::StringUtils::AsciiXDigitValue (char chr) |
Translate a character where defined as a hexadecimal value string to right integer. | |
static bool | kodi::tools::StringUtils::IsAsciiUppercaseLetter (char chr) |
Checks a character is ascii alphabetic lowercase. | |
static bool | kodi::tools::StringUtils::IsAsciiLowercaseLetter (char chr) |
Checks a character is ascii alphabetic lowercase. | |
static bool | kodi::tools::StringUtils::IsAsciiAlphaNum (char chr) |
Checks a character is within ascii alphabetic and numerical fields. | |
static bool | kodi::tools::StringUtils::ContainsKeyword (const std::string &str, const std::vector< std::string > &keywords) |
Check a string for another text. | |
Check strings for the desired state
With this, texts can be checked to see that they correspond to a required format.
|
inlinestatic |
Compare two strings by his calculated alpha numeric values.
[in] | left | Left string to compare with right |
[in] | right | Right string to compare with left |
Example:
|
inlinestatic |
Translate a character where defined as a numerical value (0-9) string to right integer.
[in] | chr | Single character to translate |
|
inlinestatic |
Translate a character where defined as a hexadecimal value string to right integer.
[in] | chr | Single character to translate |
|
inlinestatic |
Compare two strings with ignore of lower-/uppercase with given size.
Equal to EqualsNoCase only that size can defined and on return the difference between compared character becomes given.
[in] | s1 | C string to compare |
[in] | s2 | C string to compare |
[in] | n | [opt] Length to check, 0 as default to make complete |
|
inlinestatic |
Compare two strings with ignore of lower-/uppercase with given size.
Equal to EqualsNoCase only that size can defined and on return the difference between compared character becomes given.
[in] | str1 | C++ string to compare |
[in] | str2 | C++ string to compare |
[in] | n | [opt] Length to check, 0 as default to make complete |
|
inlinestatic |
Check a string for another text.
[in] | str | String to search for keywords |
[in] | keywords | List of keywords to search in text |
|
inlinestatic |
Checks a string for the ending of another string.
[in] | str1 | C++ string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the ending |
|
inlinestatic |
Checks a string for the ending of another string.
[in] | str1 | C++ string to be checked |
[in] | str2 | C++ string with which text defined in str1 is checked at the ending |
Example:
|
inlinestatic |
Checks a string for the ending of another string by ignore of upper-/lowercase.
[in] | str1 | C++ string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the ending |
|
inlinestatic |
Checks a string for the ending of another string by ignore of upper-/lowercase.
[in] | str1 | C++ string to be checked |
[in] | str2 | C++ string with which text defined in str1 is checked at the ending |
Example:
|
inlinestatic |
Compare two strings with ignore of lower-/uppercase.
[in] | s1 | C string to compare |
[in] | s2 | C string to compare |
|
inlinestatic |
Compare two strings with ignore of lower-/uppercase.
[in] | str1 | C++ string to compare |
[in] | s2 | C string to compare |
|
inlinestatic |
Compare two strings with ignore of lower-/uppercase.
[in] | str1 | C++ string to compare |
[in] | str2 | C++ string to compare |
Example:
|
inlinestatic |
Checks a character is ascii number.
[in] | chr | Single character to test |
|
inlinestatic |
Checks a character is within ascii alphabetic and numerical fields.
[in] | chr | Single character to test |
|
inlinestatic |
Checks a character is ascii alphabetic lowercase.
[in] | chr | Single character to test |
|
inlinestatic |
Checks a character is ascii alphabetic lowercase.
[in] | chr | Single character to test |
|
inlinestatic |
Checks a character is ascii hexadecimal number.
[in] | chr | Single character to test |
|
inlinestatic |
Check whether a string is an integer.
Matches [ \t]*[\-]*[0-9]+[ \t]*
str | The string to check |
Example:
|
inlinestatic |
Check whether a string is a natural number.
Matches [ \t]*[0-9]+[ \t]*
[in] | str | The string to check |
Example:
|
inlinestatic |
Check given character is a space.
Hack to check only first byte of UTF-8 character without this hack "TrimX" functions failed on Win32 and OS X with UTF-8 strings
[in] | c | Character to check |
|
inlinestatic |
Checks given pointer in string is a UTF8 letter.
[in] | str | Given character values to check, must be minimum array of 2 |
|
inlinestatic |
Checks a string for the begin of another string.
[in] | s1 | C string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the beginning |
|
inlinestatic |
Checks a string for the begin of another string.
[in] | str1 | C++ string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the beginning |
|
inlinestatic |
Checks a string for the begin of another string.
[in] | str1 | C++ string to be checked |
[in] | str2 | C++ string with which text defined in str1 is checked at the beginning |
Example:
|
inlinestatic |
Checks a string for the begin of another string by ignore of upper-/lowercase.
[in] | s1 | C string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the beginning |
|
inlinestatic |
Checks a string for the begin of another string by ignore of upper-/lowercase.
[in] | str1 | C++ string to be checked |
[in] | s2 | C string with which text defined in str1 is checked at the beginning |
|
inlinestatic |
Checks a string for the begin of another string by ignore of upper-/lowercase.
[in] | str1 | C++ string to be checked |
[in] | str2 | C++ string with which text defined in str1 is checked at the beginning |
Example:
|
inlinestatic |
UTF8 version of strlen.
Skips any non-starting bytes in the count, thus returning the number of utf8 characters.
[in] | s | c-string to find the length of. |