|
| std::optional< json > | mb::tryParseJsonStr (const std::string &json_str, std::optional< json > default_value=std::nullopt) |
| | Attempt to parse a JSON string.
|
| |
| bool | mb::strToBool (const std::string &value) |
| | Convert given string value to boolean type.
|
| |
| void | mb::toLowerCase (std::string &str) |
| | Converts a string to its lowercase variant.
|
| |
| void | mb::toUpperCase (std::string &str) |
| | Converts a string to its uppercase variant.
|
| |
| std::string | mb::trim (const std::string &s) |
| | Trims leading and trailing whitespaces from a string.
|
| |
| std::string | mb::generateTimeBasedId () |
| | Generate a time base UUID.
|
| |
| std::string | mb::generateReadableTimeId () |
| | Generates a readable time-based UUID.
|
| |
| std::string | mb::generateShortId (size_t length=16) |
| | Generates a short UUID.
|
| |
| std::vector< std::string > | mb::splitString (const std::string &input, const std::string &delimiter) |
| | Split given string based on given delimiter.
|
| |
| std::string | mb::getEnvOrDefault (const std::string &key, const std::string &defaultValue) |
| | Retrieves a value from an environment variable or a default value if the env variable was not set.
|
| |
| bool | mb::invalidChar (unsigned char c) |
| | Check if a character is invalid in a filename.
|
| |
| void | mb::sanitizeInPlace (std::string &s) |
| | Sanitize a string in-place by removing or replacing invalid characters.
|
| |
| std::string | mb::sanitizeFilename (std::string_view original, std::size_t maxLen=50, std::size_t idLen=12, std::string_view idSep="_") |
| | Sanitize a filename and ensure uniqueness.
|
| |
| std::string | mb::sanitizeFilename_JSWrapper (const std::string &original) |
| |
| int | mb::safe_stoi (const std::string &s, const int default_val) |
| | Safely convert string to integer with default fallback.
|
| |
| bool | mb::isValidIPv4 (const std::string &ip) |
| | Validates if a string is a valid IPv4 address.
|
| |
| bool | mb::isValidIPv6 (const std::string &ip) |
| | Validates if a string is a valid IPv6 address.
|
| |
| bool | mb::isValidIP (const std::string &ip) |
| | Validates if a string is a valid IP address (IPv4 or IPv6).
|
| |