![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
Functions | |
| bool | isNewLine (char c) |
| If a char is a newline character. | |
| bool | isNewLine (std::string_view str) |
| If a string is entirely composed of newline characters. | |
| bool | isWhitespace (char c) |
| If a char is a whitespace character. | |
| bool | isWhitespace (std::string_view str) |
| If a string is entirely composed of whitespace characters. | |
| bool | isNumber (char c) |
| If a char is a numerical character (0-9). | |
| bool | isNumber (std::string_view str) |
| If a string is entirely composed of numerical characters (0-9). | |
| bool | isAlphaNumeric (char c) |
| If a char is a letter (a-z, A-Z) or a numerical character (0-9). | |
| bool | isAlphaNumeric (std::string_view str) |
| If a string is entirely composed of alphanumeric characters (a-z, A-Z, 0-9). | |
| bool | contains (std::string_view s, char c) |
| bool | matches (std::string_view in, std::string_view search, bool ignoreCase=false) |
| A very basic regex-like pattern checker for ASCII strings. | |
| bool | iequals (std::string_view s1, std::string_view s2) |
| void | ltrim (std::string &s) |
| std::string_view | ltrim (std::string_view s) |
| void | rtrim (std::string &s) |
| std::string_view | rtrim (std::string_view s) |
| void | trim (std::string &s) |
| std::string_view | trim (std::string_view s) |
| void | trimInternal (std::string &s) |
| std::string | trimInternal (std::string_view s) |
| void | ltrim (std::string &s, std::string_view chars) |
| std::string_view | ltrim (std::string_view s, std::string_view chars) |
| void | rtrim (std::string &s, std::string_view chars) |
| std::string_view | rtrim (std::string_view s, std::string_view chars) |
| void | trim (std::string &s, std::string_view chars) |
| std::string_view | trim (std::string_view s, std::string_view chars) |
| void | trimInternal (std::string &s, std::string_view chars) |
| std::string | trimInternal (std::string_view s, std::string_view chars) |
| std::vector< std::string > | split (std::string_view s, char delim) |
| void | toLower (std::string &input) |
| std::string | toLower (std::string_view input) |
| void | toUpper (std::string &input) |
| std::string | toUpper (std::string_view input) |
| std::string | createRandom (uint16_t length=32, std::string_view chars="0123456789_abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
| std::string | generateUUIDv4 () |
| std::string | padNumber (int64_t number, int width) |
| void | normalizeSlashes (std::string &path, bool stripSlashPrefix=false, bool stripSlashSuffix=true) |
| void | denormalizeSlashes (std::string &path, bool stripSlashPrefix=false, bool stripSlashSuffix=true) |
| bool | toBool (std::string_view number, bool &out, int base=10) |
| bool | isBool (std::string_view number, int base=10) |
| bool | toInt (std::string_view number, std::integral auto &out, int base=10) |
| template<std::integral T> | |
| bool | isInt (std::string_view number, int base=10) |
| bool | toFloat (std::string_view number, std::floating_point auto &out) |
| template<std::floating_point T> | |
| bool | isFloat (std::string_view number) |
| std::vector< std::byte > | decodeHex (std::string_view hex) |
| std::string | encodeHex (std::span< const std::byte > hex) |
|
nodiscard |
Definition at line 55 of file String.cpp.
|
nodiscard |
Definition at line 220 of file String.cpp.
|
nodiscard |
Definition at line 292 of file String.cpp.
| void sourcepp::string::denormalizeSlashes | ( | std::string & | path, |
| bool | stripSlashPrefix = false, | ||
| bool | stripSlashSuffix = true ) |
Definition at line 270 of file String.cpp.
|
nodiscard |
Definition at line 319 of file String.cpp.
|
nodiscard |
Definition at line 232 of file String.cpp.
|
nodiscard |
Definition at line 96 of file String.cpp.
|
nodiscard |
If a char is a letter (a-z, A-Z) or a numerical character (0-9).
| c | The char. |
Definition at line 47 of file String.cpp.
|
nodiscard |
If a string is entirely composed of alphanumeric characters (a-z, A-Z, 0-9).
| str | The string. |
Definition at line 51 of file String.cpp.
|
nodiscard |
Definition at line 287 of file String.cpp.
|
nodiscard |
|
nodiscard |
|
nodiscard |
If a char is a newline character.
| c | The char. |
Definition at line 23 of file String.cpp.
|
nodiscard |
If a string is entirely composed of newline characters.
| str | The string. |
Definition at line 27 of file String.cpp.
|
nodiscard |
If a char is a numerical character (0-9).
| c | The char. |
Definition at line 39 of file String.cpp.
|
nodiscard |
If a string is entirely composed of numerical characters (0-9).
| str | The string. |
Definition at line 43 of file String.cpp.
|
nodiscard |
If a char is a whitespace character.
| c | The char. |
Definition at line 31 of file String.cpp.
|
nodiscard |
If a string is entirely composed of whitespace characters.
| str | The string. |
Definition at line 35 of file String.cpp.
| void sourcepp::string::ltrim | ( | std::string & | s | ) |
Definition at line 102 of file String.cpp.
| void sourcepp::string::ltrim | ( | std::string & | s, |
| std::string_view | chars ) |
Definition at line 143 of file String.cpp.
|
nodiscard |
Definition at line 106 of file String.cpp.
|
nodiscard |
Definition at line 149 of file String.cpp.
|
nodiscard |
A very basic regex-like pattern checker for ASCII strings.
Supports: %? - matches any character w - matches a whitespace character (defined by std::isspace) a - matches a letter (A-Z, a-z) u - matches an uppercase letter (A-Z) l - matches a lowercase letter (a-z) d - matches a single digit (0-9) %% - escaped percent character
Definition at line 59 of file String.cpp.
| void sourcepp::string::normalizeSlashes | ( | std::string & | path, |
| bool | stripSlashPrefix = false, | ||
| bool | stripSlashSuffix = true ) |
Definition at line 260 of file String.cpp.
|
nodiscard |
Definition at line 256 of file String.cpp.
| void sourcepp::string::rtrim | ( | std::string & | s | ) |
Definition at line 113 of file String.cpp.
| void sourcepp::string::rtrim | ( | std::string & | s, |
| std::string_view | chars ) |
Definition at line 156 of file String.cpp.
|
nodiscard |
Definition at line 117 of file String.cpp.
|
nodiscard |
Definition at line 162 of file String.cpp.
|
nodiscard |
Definition at line 190 of file String.cpp.
| bool sourcepp::string::toBool | ( | std::string_view | number, |
| bool & | out, | ||
| int | base = 10 ) |
Definition at line 280 of file String.cpp.
| bool sourcepp::string::toFloat | ( | std::string_view | number, |
| std::floating_point auto & | out ) |
| bool sourcepp::string::toInt | ( | std::string_view | number, |
| std::integral auto & | out, | ||
| int | base = 10 ) |
| void sourcepp::string::toLower | ( | std::string & | input | ) |
Definition at line 200 of file String.cpp.
|
nodiscard |
Definition at line 204 of file String.cpp.
| void sourcepp::string::toUpper | ( | std::string & | input | ) |
Definition at line 210 of file String.cpp.
|
nodiscard |
Definition at line 214 of file String.cpp.
| void sourcepp::string::trim | ( | std::string & | s | ) |
Definition at line 124 of file String.cpp.
| void sourcepp::string::trim | ( | std::string & | s, |
| std::string_view | chars ) |
Definition at line 169 of file String.cpp.
|
nodiscard |
Definition at line 129 of file String.cpp.
|
nodiscard |
Definition at line 174 of file String.cpp.
| void sourcepp::string::trimInternal | ( | std::string & | s | ) |
Definition at line 133 of file String.cpp.
| void sourcepp::string::trimInternal | ( | std::string & | s, |
| std::string_view | chars ) |
Definition at line 178 of file String.cpp.
|
nodiscard |
Definition at line 137 of file String.cpp.
|
nodiscard |
Definition at line 182 of file String.cpp.