OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::string Namespace Reference

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 (const STRING &str, const std::string &prefix)
 
template<typename STRING >
bool starts_with (const STRING &str, const char *prefix)
 
template<typename STRING >
bool starts_with_delim (const STRING &str, const std::string &prefix, const char delim)
 
template<typename STRING >
bool ends_with (const STRING &str, const std::string &suffix)
 
template<typename STRING >
bool ends_with (const STRING &str, const char *suffix)
 
template<typename STRING >
bool ends_with (const STRING &str, const char c)
 
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)
 

Function Documentation

◆ add_leading()

std::string openvpn::string::add_leading ( const std::string &  str,
const size_t  min_len,
const char  c 
)
inline

Definition at line 161 of file string.hpp.

◆ add_trailing()

void openvpn::string::add_trailing ( std::string &  str,
const char  c 
)
inline

Definition at line 184 of file string.hpp.

Here is the caller graph for this function:

◆ add_trailing_copy()

std::string openvpn::string::add_trailing_copy ( const std::string &  str,
const char  c 
)
inline

Definition at line 175 of file string.hpp.

Here is the caller graph for this function:

◆ add_trailing_crlf()

void openvpn::string::add_trailing_crlf ( std::string &  str)
inline

Definition at line 191 of file string.hpp.

Here is the caller graph for this function:

◆ add_trailing_crlf_copy()

std::string openvpn::string::add_trailing_crlf_copy ( std::string  str)
inline

Definition at line 207 of file string.hpp.

Here is the caller graph for this function:

◆ add_trailing_unless_empty_copy()

std::string openvpn::string::add_trailing_unless_empty_copy ( const std::string &  str,
const char  c 
)
inline

Definition at line 214 of file string.hpp.

◆ contains_non_space_ctrl()

bool openvpn::string::contains_non_space_ctrl ( const std::string &  str)
inline

Definition at line 338 of file string.hpp.

◆ contains_space()

bool openvpn::string::contains_space ( const std::string &  str)
inline

Definition at line 347 of file string.hpp.

◆ copy_fill()

void openvpn::string::copy_fill ( void *  dest,
const std::string &  src,
const size_t  dest_size 
)
inline

Definition at line 63 of file string.hpp.

◆ embedded_null()

bool openvpn::string::embedded_null ( const char *  str,
size_t  len 
)
inline

Definition at line 238 of file string.hpp.

Here is the caller graph for this function:

◆ ends_with() [1/3]

template<typename STRING >
bool openvpn::string::ends_with ( const STRING &  str,
const char *  suffix 
)
inline

Definition at line 122 of file string.hpp.

◆ ends_with() [2/3]

template<typename STRING >
bool openvpn::string::ends_with ( const STRING &  str,
const char  c 
)
inline

Definition at line 134 of file string.hpp.

◆ ends_with() [3/3]

template<typename STRING >
bool openvpn::string::ends_with ( const STRING &  str,
const std::string &  suffix 
)
inline

Definition at line 111 of file string.hpp.

Here is the caller graph for this function:

◆ ends_with_crlf()

template<typename STRING >
bool openvpn::string::ends_with_crlf ( const STRING &  str)
inline

Definition at line 148 of file string.hpp.

Here is the caller graph for this function:

◆ ends_with_newline()

template<typename STRING >
bool openvpn::string::ends_with_newline ( const STRING &  str)
inline

Definition at line 141 of file string.hpp.

Here is the caller graph for this function:

◆ first_line()

std::string openvpn::string::first_line ( const std::string &  str)
inline

Definition at line 272 of file string.hpp.

◆ from_argv()

std::vector< std::string > openvpn::string::from_argv ( int  argc,
char *  argv[],
const bool  skip_first 
)
inline

Definition at line 541 of file string.hpp.

Here is the caller graph for this function:

◆ indent()

std::string openvpn::string::indent ( const std::string &  str,
const int  first,
const int  remaining 
)
inline

Definition at line 421 of file string.hpp.

Here is the caller graph for this function:

◆ is_alpha()

bool openvpn::string::is_alpha ( const char  c)
inline

Definition at line 289 of file string.hpp.

◆ is_alphanumeric()

bool openvpn::string::is_alphanumeric ( const char  c)
inline

Definition at line 294 of file string.hpp.

Here is the caller graph for this function:

◆ is_ctrl() [1/2]

bool openvpn::string::is_ctrl ( const char  c)
inline

Definition at line 309 of file string.hpp.

Here is the caller graph for this function:

◆ is_ctrl() [2/2]

bool openvpn::string::is_ctrl ( const unsigned char  c)
inline

Definition at line 314 of file string.hpp.

◆ is_digit()

bool openvpn::string::is_digit ( const char  c)
inline

Definition at line 284 of file string.hpp.

Here is the caller graph for this function:

◆ is_empty() [1/2]

bool openvpn::string::is_empty ( const char *  str)
inline

Definition at line 457 of file string.hpp.

◆ is_empty() [2/2]

bool openvpn::string::is_empty ( const std::string &  str)
inline

Definition at line 448 of file string.hpp.

Here is the caller graph for this function:

◆ is_multiline()

bool openvpn::string::is_multiline ( const std::string &  str)
inline

Definition at line 255 of file string.hpp.

Here is the caller graph for this function:

◆ is_printable() [1/3]

bool openvpn::string::is_printable ( const char  c)
inline

Definition at line 299 of file string.hpp.

Here is the caller graph for this function:

◆ is_printable() [2/3]

bool openvpn::string::is_printable ( const std::string &  str)
inline

Definition at line 329 of file string.hpp.

◆ is_printable() [3/3]

bool openvpn::string::is_printable ( const unsigned char  c)
inline

Definition at line 304 of file string.hpp.

◆ is_space()

bool openvpn::string::is_space ( const char  c)
inline

Definition at line 279 of file string.hpp.

Here is the caller graph for this function:

◆ is_true()

bool openvpn::string::is_true ( const std::string &  str)
inline

Definition at line 73 of file string.hpp.

Here is the caller graph for this function:

◆ is_word()

bool openvpn::string::is_word ( const std::string &  str)
inline

Definition at line 320 of file string.hpp.

Here is the caller graph for this function:

◆ join()

template<class T >
auto openvpn::string::join ( const T &  strings,
const typename T::value_type &  delim,
const bool  tail = false 
)
inline

Definition at line 521 of file string.hpp.

Here is the caller graph for this function:

◆ len_without_trailing_nulls()

size_t openvpn::string::len_without_trailing_nulls ( const char *  str,
size_t  len 
)
inline

Definition at line 247 of file string.hpp.

◆ reduce_spaces()

std::string openvpn::string::reduce_spaces ( const std::string &  str,
const char  rep 
)
inline

Definition at line 385 of file string.hpp.

Here is the caller graph for this function:

◆ remove_blanks()

std::string openvpn::string::remove_blanks ( const std::string &  str)
inline

Definition at line 620 of file string.hpp.

Here is the caller graph for this function:

◆ remove_char()

std::string openvpn::string::remove_char ( const std::string &  str,
const char  remove 
)
inline

Definition at line 671 of file string.hpp.

◆ remove_spaces()

std::string openvpn::string::remove_spaces ( const std::string &  str)
inline

Definition at line 356 of file string.hpp.

◆ repeat()

std::string openvpn::string::repeat ( const char  c,
size_t  n 
)
inline

Definition at line 405 of file string.hpp.

Here is the caller graph for this function:

◆ replace_copy()

std::string openvpn::string::replace_copy ( const std::string &  str,
const char  from,
const char  to 
)
inline

Definition at line 438 of file string.hpp.

◆ replace_spaces()

std::string openvpn::string::replace_spaces ( const std::string &  str,
const char  rep 
)
inline

Definition at line 369 of file string.hpp.

◆ spaces()

std::string openvpn::string::spaces ( size_t  n)
inline

Definition at line 415 of file string.hpp.

Here is the caller graph for this function:

◆ split()

template<typename T >
std::vector< T > openvpn::string::split ( const T &  str,
const typename T::value_type  sep,
const int  maxsplit = -1 
)
inline

Definition at line 492 of file string.hpp.

Here is the caller graph for this function:

◆ starts_with() [1/2]

template<typename STRING >
bool openvpn::string::starts_with ( const STRING &  str,
const char *  prefix 
)
inline

Definition at line 90 of file string.hpp.

◆ starts_with() [2/2]

template<typename STRING >
bool openvpn::string::starts_with ( const STRING &  str,
const std::string &  prefix 
)
inline

Definition at line 79 of file string.hpp.

Here is the caller graph for this function:

◆ starts_with_delim()

template<typename STRING >
bool openvpn::string::starts_with_delim ( const STRING &  str,
const std::string &  prefix,
const char  delim 
)
inline

Definition at line 102 of file string.hpp.

◆ strcasecmp() [1/4]

int openvpn::string::strcasecmp ( const char *  s1,
const char *  s2 
)
inline

Definition at line 29 of file string.hpp.

Here is the caller graph for this function:

◆ strcasecmp() [2/4]

int openvpn::string::strcasecmp ( const char *  s1,
const std::string &  s2 
)
inline

Definition at line 43 of file string.hpp.

◆ strcasecmp() [3/4]

int openvpn::string::strcasecmp ( const std::string &  s1,
const char *  s2 
)
inline

Definition at line 38 of file string.hpp.

◆ strcasecmp() [4/4]

int openvpn::string::strcasecmp ( const std::string &  s1,
const std::string &  s2 
)
inline

Definition at line 48 of file string.hpp.

◆ strncpynt()

void openvpn::string::strncpynt ( char *  dest,
const char *  src,
size_t  maxlen 
)
inline

Definition at line 54 of file string.hpp.

Here is the caller graph for this function:

◆ to_delim()

std::string openvpn::string::to_delim ( const std::string &  str,
const char  delim 
)
inline

Definition at line 262 of file string.hpp.

Here is the caller graph for this function:

◆ to_lower()

void openvpn::string::to_lower ( std::string &  str)
inline

Definition at line 607 of file string.hpp.

Here is the caller graph for this function:

◆ to_lower_copy()

std::string openvpn::string::to_lower_copy ( const std::string &  str)
inline

Definition at line 587 of file string.hpp.

Here is the caller graph for this function:

◆ to_upper()

void openvpn::string::to_upper ( std::string &  str)
inline

Definition at line 612 of file string.hpp.

◆ to_upper_copy()

std::string openvpn::string::to_upper_copy ( const std::string &  str)
inline

Definition at line 577 of file string.hpp.

Here is the caller graph for this function:

◆ trim()

void openvpn::string::trim ( std::string &  str)
inline

Definition at line 597 of file string.hpp.

Here is the caller graph for this function:

◆ trim_copy()

std::string openvpn::string::trim_copy ( const std::string &  str)
inline

Definition at line 559 of file string.hpp.

Here is the caller graph for this function:

◆ trim_crlf()

template<typename STRING >
void openvpn::string::trim_crlf ( STRING &  str)
inline

Definition at line 224 of file string.hpp.

Here is the caller graph for this function:

◆ trim_crlf_copy()

std::string openvpn::string::trim_crlf_copy ( std::string  str)
inline

Definition at line 231 of file string.hpp.

Here is the caller graph for this function:

◆ trim_left()

void openvpn::string::trim_left ( std::string &  str)
inline

Definition at line 602 of file string.hpp.

◆ trim_left_copy()

std::string openvpn::string::trim_left_copy ( const std::string &  str)
inline

Definition at line 549 of file string.hpp.

Here is the caller graph for this function:

◆ unix2dos()

std::string openvpn::string::unix2dos ( const std::string &  str,
const bool  force_eol = false 
)
inline

Definition at line 469 of file string.hpp.

Here is the caller graph for this function: