|
OpenVPN 3 Core Library
|
Functions | |
| int | strcasecmp (const char *s1, const char *s2) |
| int | strcasecmp (const std::string &s1, const char *s2) |
| int | strcasecmp (const char *s1, const std::string &s2) |
| int | strcasecmp (const std::string &s1, const std::string &s2) |
| void | strncpynt (char *dest, const char *src, size_t maxlen) |
| void | copy_fill (void *dest, const std::string &src, const size_t dest_size) |
| bool | is_true (const std::string &str) |
| template<typename STRING > | |
| bool | starts_with_delim (const STRING &str, const std::string &prefix, const char delim) |
| template<typename STRING > | |
| bool | ends_with_newline (const STRING &str) |
| template<typename STRING > | |
| bool | ends_with_crlf (const STRING &str) |
| std::string | add_leading (const std::string &str, const size_t min_len, const char c) |
| std::string | add_trailing_copy (const std::string &str, const char c) |
| void | add_trailing (std::string &str, const char c) |
| void | add_trailing_crlf (std::string &str) |
| std::string | add_trailing_crlf_copy (std::string str) |
| std::string | add_trailing_unless_empty_copy (const std::string &str, const char c) |
| template<typename STRING > | |
| void | trim_crlf (STRING &str) |
| std::string | trim_crlf_copy (std::string str) |
| bool | embedded_null (const char *str, size_t len) |
| size_t | len_without_trailing_nulls (const char *str, size_t len) |
| bool | is_multiline (const std::string &str) |
| std::string | to_delim (const std::string &str, const char delim) |
| std::string | first_line (const std::string &str) |
| bool | is_space (const char c) |
| bool | is_digit (const char c) |
| bool | is_alpha (const char c) |
| bool | is_alphanumeric (const char c) |
| bool | is_printable (const char c) |
| bool | is_printable (const unsigned char c) |
| bool | is_ctrl (const char c) |
| bool | is_ctrl (const unsigned char c) |
| bool | is_word (const std::string &str) |
| bool | is_printable (const std::string &str) |
| bool | contains_non_space_ctrl (const std::string &str) |
| bool | contains_space (const std::string &str) |
| std::string | remove_spaces (const std::string &str) |
| std::string | replace_spaces (const std::string &str, const char rep) |
| std::string | reduce_spaces (const std::string &str, const char rep) |
| std::string | repeat (const char c, size_t n) |
| std::string | spaces (size_t n) |
| std::string | indent (const std::string &str, const int first, const int remaining) |
| std::string | replace_copy (const std::string &str, const char from, const char to) |
| bool | is_empty (const std::string &str) |
| bool | is_empty (const char *str) |
| std::string | unix2dos (const std::string &str, const bool force_eol=false) |
| template<typename T > | |
| std::vector< T > | split (const T &str, const typename T::value_type sep, const int maxsplit=-1) |
| template<class T > | |
| auto | join (const T &strings, const typename T::value_type &delim, const bool tail=false) |
| std::vector< std::string > | from_argv (int argc, char *argv[], const bool skip_first) |
| std::string | trim_left_copy (const std::string &str) |
| std::string | trim_copy (const std::string &str) |
| std::string | to_upper_copy (const std::string &str) |
| std::string | to_lower_copy (const std::string &str) |
| void | trim (std::string &str) |
| void | trim_left (std::string &str) |
| void | to_lower (std::string &str) |
| void | to_upper (std::string &str) |
| std::string | remove_blanks (const std::string &str) |
| std::string | remove_char (const std::string &str, const char remove) |
| template<typename... ArgsT> | |
| auto | args_to_string (std::string_view delim, ArgsT &&...args) -> std::string |
| Convert variadic arguments to a string. | |
| template<typename... ArgsT> | |
| auto | format_safe (std::string format, ArgsT &&...args) noexcept -> std::optional< std::string > |
| Format a string with error handling. | |
|
inline |
Definition at line 112 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 164 of file string.hpp.
|
inline |
Convert variadic arguments to a string.
This function takes a delimiter and a variadic number of arguments, and concatenates them into a single string, separated by the specified delimiter. The function uses a fold expression to handle the variadic arguments and formats each argument using format. The resulting string is returned.
| ArgsT | variadic template parameter pack for the arguments to be formatted. |
| delim | The delimiter to be used for separating the arguments in the resulting string. |
| args | The variadic arguments to be concatenated into a string. |
| format_error | if formatting fails. |
| exceptions | from std::string operations |
Definition at line 659 of file string.hpp.
|
inline |
Definition at line 298 of file string.hpp.
|
inline |
Definition at line 307 of file string.hpp.
|
inline |
Definition at line 67 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 220 of file string.hpp.
|
inlinenoexcept |
Format a string with error handling.
This function attempts to format a string using the provided format and arguments. If an exception occurs during formatting, it catches the exception and returns std::nullopt to indicate that the formatting failed.
| ArgsT | variadic template parameter pack for the arguments to be formatted. |
| format | The format string to be used for formatting. |
| args | The arguments to be formatted into the string. |
Definition at line 681 of file string.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 249 of file string.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 274 of file string.hpp.
|
inline |
|
inline |
Definition at line 417 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 289 of file string.hpp.
|
inline |
Definition at line 264 of file string.hpp.
|
inline |
Define a common interpretation of what constitutes a space character.
According to the Notes section at https://en.cppreference.com/w/cpp/string/byte/isspace.html:
"Like all other functions from <cctype>, the behavior of <tt>std::isspace</tt> is undefined if the argument's value is neither representable as <tt>unsigned char</tt> nor equal to <tt>EOF</tt>. To use these functions safely with plain chars (or signed chars), the argument should first be converted to <tt>unsigned char</tt>"
Definition at line 239 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 196 of file string.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 631 of file string.hpp.
|
inline |
Definition at line 316 of file string.hpp.
|
inline |
|
inline |
Definition at line 398 of file string.hpp.
|
inline |
Definition at line 329 of file string.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 84 of file string.hpp.
|
inline |
|
inline |
Definition at line 47 of file string.hpp.
|
inline |
Definition at line 42 of file string.hpp.
|
inline |
Definition at line 52 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 572 of file string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 562 of file string.hpp.
|
inline |
|
inline |