![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
Functions | |
bool | contains (std::string_view s, char c) |
bool | matches (std::string_view in, std::string_view search) |
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 | 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) |
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, char pad='0') |
void | normalizeSlashes (std::string &path, bool stripSlashPrefix=false, bool stripSlashSuffix=true) |
void | denormalizeSlashes (std::string &path, bool stripSlashPrefix=false, bool stripSlashSuffix=true) |
std::from_chars_result | toBool (std::string_view number, bool &out, int base=10) |
std::from_chars_result | toInt (std::string_view number, std::integral auto &out, int base=10) |
std::from_chars_result | toFloat (std::string_view number, std::floating_point auto &out) |
bool sourcepp::string::contains | ( | std::string_view | s, |
char | c | ||
) |
Definition at line 20 of file String.cpp.
std::string sourcepp::string::createRandom | ( | uint16_t | length = 32 , |
std::string_view | chars = "0123456789_abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
||
) |
Definition at line 165 of file String.cpp.
void sourcepp::string::denormalizeSlashes | ( | std::string & | path, |
bool | stripSlashPrefix = false , |
||
bool | stripSlashSuffix = true |
||
) |
Definition at line 216 of file String.cpp.
std::string sourcepp::string::generateUUIDv4 | ( | ) |
Definition at line 177 of file String.cpp.
bool sourcepp::string::iequals | ( | std::string_view | s1, |
std::string_view | s2 | ||
) |
Definition at line 61 of file String.cpp.
void sourcepp::string::ltrim | ( | std::string & | s | ) |
Definition at line 67 of file String.cpp.
void sourcepp::string::ltrim | ( | std::string & | s, |
std::string_view | chars | ||
) |
Definition at line 98 of file String.cpp.
std::string_view sourcepp::string::ltrim | ( | std::string_view | s | ) |
Definition at line 71 of file String.cpp.
std::string_view sourcepp::string::ltrim | ( | std::string_view | s, |
std::string_view | chars | ||
) |
Definition at line 104 of file String.cpp.
bool sourcepp::string::matches | ( | std::string_view | in, |
std::string_view | search | ||
) |
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 24 of file String.cpp.
void sourcepp::string::normalizeSlashes | ( | std::string & | path, |
bool | stripSlashPrefix = false , |
||
bool | stripSlashSuffix = true |
||
) |
Definition at line 206 of file String.cpp.
std::string sourcepp::string::padNumber | ( | int64_t | number, |
int | width, | ||
char | pad = '0' |
||
) |
Definition at line 201 of file String.cpp.
void sourcepp::string::rtrim | ( | std::string & | s | ) |
Definition at line 78 of file String.cpp.
void sourcepp::string::rtrim | ( | std::string & | s, |
std::string_view | chars | ||
) |
Definition at line 111 of file String.cpp.
std::string_view sourcepp::string::rtrim | ( | std::string_view | s | ) |
Definition at line 82 of file String.cpp.
std::string_view sourcepp::string::rtrim | ( | std::string_view | s, |
std::string_view | chars | ||
) |
Definition at line 117 of file String.cpp.
std::vector< std::string > sourcepp::string::split | ( | std::string_view | s, |
char | delim | ||
) |
Definition at line 135 of file String.cpp.
std::from_chars_result sourcepp::string::toBool | ( | std::string_view | number, |
bool & | out, | ||
int | base = 10 |
||
) |
Definition at line 226 of file String.cpp.
|
inline |
|
inline |
void sourcepp::string::toLower | ( | std::string & | input | ) |
Definition at line 145 of file String.cpp.
std::string sourcepp::string::toLower | ( | std::string_view | input | ) |
Definition at line 149 of file String.cpp.
void sourcepp::string::toUpper | ( | std::string & | input | ) |
Definition at line 155 of file String.cpp.
std::string sourcepp::string::toUpper | ( | std::string_view | input | ) |
Definition at line 159 of file String.cpp.
void sourcepp::string::trim | ( | std::string & | s | ) |
Definition at line 89 of file String.cpp.
void sourcepp::string::trim | ( | std::string & | s, |
std::string_view | chars | ||
) |
Definition at line 124 of file String.cpp.
std::string_view sourcepp::string::trim | ( | std::string_view | s | ) |
Definition at line 94 of file String.cpp.
std::string_view sourcepp::string::trim | ( | std::string_view | s, |
std::string_view | chars | ||
) |
Definition at line 129 of file String.cpp.