Thrill  0.1

Classes

struct  less_icase_asc
 Case-insensitive less order relation functional class for std::map, etc. More...
 
struct  less_icase_desc
 
struct  LevenshteinStandardICaseParameters
 Standard parameters to Levenshtein distance function. More...
 
struct  LevenshteinStandardParameters
 Standard parameters to levenshtein distance function. More...
 

Functions

std::istream & appendline (std::istream &is, std::string &str, char delim)
 
int compare_icase (const char *a, const char *b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const char *a, const std::string &b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const std::string &a, const char *b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const std::string &a, const std::string &b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
bool contains (const std::string &str, const std::string &pattern)
 Tests of string contains pattern. More...
 
bool contains (const std::string &str, const char *pattern)
 Tests of string contains pattern. More...
 
bool contains (const std::string &str, const char ch)
 Tests of string contains character. More...
 
bool contains_word (const std::string &str, const char *word)
 Search the given string for a whitespace-delimited word. More...
 
bool contains_word (const std::string &str, const std::string &word)
 Search the given string for a whitespace-delimited word. More...
 
bool ends_with (const char *str, const char *match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with (const char *str, const std::string &match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with (const std::string &str, const char *match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with (const std::string &str, const std::string &match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with_icase (const std::string &str, const char *match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with_icase (const std::string &str, const std::string &match)
 Checks if the given match string is located at the end of this string. More...
 
bool equal_icase (const char *a, const char *b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const char *a, const std::string &b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const std::string &a, const char *b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const std::string &a, const std::string &b)
 returns true if a == b without regard for letter case More...
 
std::string & erase_all (std::string *str, char drop=' ')
 Remove all occurrences of the given character in-place. More...
 
std::string & erase_all (std::string *str, const char *drop)
 Remove all occurrences of the given characters in-place. More...
 
std::string & erase_all (std::string *str, const std::string &drop)
 Remove all occurrences of the given characters in-place. More...
 
std::string erase_all (const std::string &str, char drop=' ')
 Remove all occurrences of the given character, return copy of string. More...
 
std::string erase_all (const std::string &str, const char *drop)
 Remove all occurrences of the given characters, return copy of string. More...
 
std::string erase_all (const std::string &str, const std::string &drop)
 Remove all occurrences of the given characters, return copy of string. More...
 
std::string escape_html (const std::string &str)
 Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
 
std::string escape_html (const char *str)
 Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
 
std::string escape_uri (const std::string &str)
 Escape a string into a URI-encoding. More...
 
std::string escape_uri (const char *str)
 Escape a string into a URI-encoding. More...
 
std::string & expand_environment_variables (std::string *s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string expand_environment_variables (const std::string &s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string expand_environment_variables (const char *s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string extract_between (const std::string &str, const char *sep1, const char *sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const char *sep1, const std::string &sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const std::string &sep1, const char *sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const std::string &sep1, const std::string &sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string format_iec_units (uint64_t number, int precision)
 Format number as something like 1 TiB. More...
 
std::string format_si_units (uint64_t number, int precision)
 Format number as something like 1 TB. More...
 
static uint32_t hash_djb2 (const unsigned char *str)
 Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_djb2 (const char *str)
 Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_djb2 (const unsigned char *str, size_t size)
 Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_djb2 (const char *str, size_t size)
 Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_djb2 (const std::string &str)
 Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_sdbm (const unsigned char *str)
 Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_sdbm (const char *str)
 Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_sdbm (const unsigned char *str, size_t size)
 Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_sdbm (const char *str, size_t size)
 Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
 
static uint32_t hash_sdbm (const std::string &str)
 Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
 
size_t index_of (const std::vector< std::string > &list, const char *str)
 Attempts to find str in the list and return the index. More...
 
size_t index_of (const std::vector< std::string > &list, const std::string &str)
 Attempts to find str in the list and return the index. More...
 
size_t index_of_icase (const std::vector< std::string > &list, const char *str)
 Attempts to find str in the list and return the index using case-insensitive comparisons. More...
 
size_t index_of_icase (const std::vector< std::string > &list, const std::string &str)
 Attempts to find str in the list and return the index using case-insensitive comparisons. More...
 
bool less_icase (const char *a, const char *b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const char *a, const std::string &b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const std::string &a, const char *b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const std::string &a, const std::string &b)
 returns true if a < b without regard for letter case More...
 
static size_t levenshtein (const char *a, const char *b)
 Computes the Levenshtein string distance between two strings. More...
 
static size_t levenshtein (const std::string &a, const std::string &b)
 Computes the Levenshtein string distance between two strings. More...
 
template<typename Param >
static size_t levenshtein_algorithm (const char *a, size_t a_size, const char *b, size_t b_size)
 Computes the Levenshtein string distance also called edit distance between two strings. More...
 
static size_t levenshtein_icase (const char *a, const char *b)
 Computes the Levenshtein string distance between two strings. More...
 
static size_t levenshtein_icase (const std::string &a, const std::string &b)
 Computes the Levenshtein string distance between two strings. More...
 
std::string pad (const std::string &s, size_t len, char pad_char=' ')
 Truncate or pad string to exactly len characters. More...
 
bool parse_si_iec_units (const char *str, uint64_t *out_size, char default_unit=0)
 Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
 
bool parse_si_iec_units (const std::string &str, uint64_t *out_size, char default_unit=0)
 Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
 
std::vector< std::string > split_words (const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string by whitespaces into distinct words. More...
 
std::string ssnprintf (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2
 Helper for return the result of a snprintf() call inside a std::string. More...
 
template<typename String = std::string>
String ssnprintf_generic (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2
 Helper for return the result of a snprintf() call inside a string object. More...
 
std::string ssprintf (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1
 Helper for return the result of a sprintf() call inside a std::string. More...
 
template<typename String = std::string>
String ssprintf_generic (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1
 Helper for return the result of a sprintf() call inside a string object. More...
 
bool starts_with (const char *str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with (const char *str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with (const std::string &str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with (const std::string &str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const char *str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const char *str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const std::string &str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const std::string &str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
char to_lower (char ch)
 Transform the given character to lower case without any localization. More...
 
std::string & to_lower (std::string *str)
 Transforms the given string to lowercase and returns a reference to it. More...
 
std::string to_lower (const std::string &str)
 Returns a copy of the given string converted to lowercase. More...
 
char to_upper (char ch)
 Transform the given character to upper case without any localization. More...
 
std::string & to_upper (std::string *str)
 Transforms the given string to uppercase and returns a reference to it. More...
 
std::string to_upper (const std::string &str)
 Returns a copy of the given string converted to uppercase. More...
 
std::string union_words (const std::string &wordsA, const std::string &wordsB)
 Return union of two keyword sets. More...
 
std::string word_wrap (const std::string &str, unsigned int wrap=80)
 Try to wrap a string to 80 columns without split words. More...
 

Base64 Encoding and Decoding

std::string base64_encode (const void *data, size_t size, size_t line_break=0)
 Encode the given binary data into base64 representation as described in RFC 2045 or RFC 3548. More...
 
std::string base64_encode (const std::string &str, size_t line_break=0)
 Encode the given binary string into base64 representation as described in RFC 2045 or RFC 3548. More...
 
std::string base64_decode (const void *data, size_t size, bool strict=true)
 Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data. More...
 
std::string base64_decode (const std::string &str, bool strict=true)
 Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data. More...
 

Bitdump Methods

std::string bitdump_le8 (const void *const data, size_t size)
 Dump a (binary) string as a sequence of 8-bit little-endian bytes. More...
 
std::string bitdump_le8 (const std::string &str)
 Dump a (binary) string as a sequence of 8-bit little-endian bytes. More...
 
template<typename Type >
std::string bitdump_le8_type (const Type &t)
 Dump a (binary) item as a sequence of 8-bit little-endian bytes. More...
 
std::string bitdump_be8 (const void *const data, size_t size)
 Dump a (binary) string as a sequence of 8-bit big-endian bytes. More...
 
std::string bitdump_be8 (const std::string &str)
 Dump a (binary) string as a sequence of 8-bit big-endian bytes. More...
 
template<typename Type >
std::string bitdump_be8_type (const Type &t)
 Dump a (binary) item as a sequence of 8-bit big-endian bytes. More...
 

Hexdump Methods

std::string hexdump (const void *const data, size_t size)
 Dump a (binary) string as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::string &str)
 Dump a (binary) string as a sequence of uppercase hexadecimal pairs. More...
 
template<typename Type >
std::string hexdump_type (const Type &t)
 Dump a (binary) item as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::vector< char > &data)
 Dump a char vector as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::vector< uint8_t > &data)
 Dump a uint8_t vector as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump_sourcecode (const std::string &str, const std::string &var_name="name")
 Dump a (binary) string into a C source code snippet. More...
 
std::string hexdump_lc (const void *const data, size_t size)
 Dump a (binary) string as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::string &str)
 Dump a (binary) string as a sequence of lowercase hexadecimal pairs. More...
 
template<typename Type >
std::string hexdump_lc_type (const Type &t)
 Dump a (binary) item as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::vector< char > &data)
 Dump a char vector as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::vector< uint8_t > &data)
 Dump a uint8_t vector as a sequence of lowercase hexadecimal pairs. More...
 
std::string parse_hexdump (const std::string &str)
 Read a string as a sequence of hexadecimal pairs. More...
 

Split and Join

std::string join (char glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue character between each pair from the sequence. More...
 
std::string join (const char *glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue string between each pair from the sequence. More...
 
std::string join (const std::string &glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue string between each pair from the sequence. More...
 
template<typename Glue , typename Iterator >
static std::string join (Glue glue, Iterator first, Iterator last)
 Join a sequence of strings by some glue string between each pair from the sequence. More...
 
template<typename Container >
static std::string join (char glue, const Container &parts)
 Join a Container of strings by some glue character between each pair from the sequence. More...
 
template<typename Container >
static std::string join (const char *glue, const Container &parts)
 Join a Container of strings by some glue string between each pair from the sequence. More...
 
template<typename Container >
static std::string join (const std::string &glue, const Container &parts)
 Join a Container of strings by some glue string between each pair from the sequence. More...
 
std::string join_quoted (const std::vector< std::string > &str, char sep, char quote, char escape)
 Join a vector of strings using a separator character. More...
 
std::string join_quoted (const std::vector< std::string > &str)
 Join a vector of strings using spaces as separator character. More...
 
std::vector< std::string > split (char sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split (const char *sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split (const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split_quoted (const std::string &str, char sep, char quote, char escape)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split_quoted (const std::string &str)
 Split the given string at each space into distinct substrings. More...
 
template<typename Functor >
static void split_view (char sep, const std::string &str, Functor &&callback, std::string::size_type limit=std::string::npos)
 Split the given string at each separator character into distinct substrings, and call the given callback with a StringView for each substring. More...
 

Search and Replace

std::string & replace_first (std::string *str, const std::string &needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const std::string &needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const char *needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const char *needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, char needle, char instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const std::string &needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const std::string &needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const char *needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const char *needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, char needle, char instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_all (std::string *str, const std::string &needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const std::string &needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const char *needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const char *needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, char needle, char instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const std::string &needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const std::string &needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const char *needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const char *needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, char needle, char instead)
 Replace all occurrences of needle in str. More...
 

Trim

std::string & trim (std::string *str)
 Trims the given string in-place on the left and right. More...
 
std::string & trim (std::string *str, const char *drop)
 Trims the given string in-place on the left and right. More...
 
std::string & trim (std::string *str, const std::string &drop)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str, const char *drop)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str, const std::string &drop)
 Trims the given string in-place on the left and right. More...
 
std::string & trim_right (std::string *str)
 Trims the given string in-place only on the right. More...
 
std::string & trim_right (std::string *str, const char *drop)
 Trims the given string in-place only on the right. More...
 
std::string & trim_right (std::string *str, const std::string &drop)
 Trims the given string in-place only on the right. More...
 
std::string trim_right (const std::string &str)
 Trims the given string only on the right. More...
 
std::string trim_right (const std::string &str, const char *drop)
 Trims the given string only on the right. More...
 
std::string trim_right (const std::string &str, const std::string &drop)
 Trims the given string only on the right. More...
 
std::string & trim_left (std::string *str)
 Trims the given string in-place only on the left. More...
 
std::string & trim_left (std::string *str, const char *drop)
 Trims the given string in-place only on the left. More...
 
std::string & trim_left (std::string *str, const std::string &drop)
 Trims the given string in-place only on the left. More...
 
std::string trim_left (const std::string &str)
 Trims the given string only on the left. More...
 
std::string trim_left (const std::string &str, const char *drop)
 Trims the given string only on the left. More...
 
std::string trim_left (const std::string &str, const std::string &drop)
 Trims the given string only on the left. More...
 

Detailed Description

Simple string manipulations

Function Documentation

◆ appendline()

std::istream & appendline ( std::istream &  is,
std::string &  str,
char  delim = '\n' 
)

like std::getline(istream, string, delim) except that it appends to the string, possibly reusing buffer capacity.

Definition at line 17 of file appendline.cpp.

References max().

◆ base64_decode() [1/2]

std::string base64_decode ( const void *  data,
size_t  size,
bool  strict = true 
)

Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data.

If a non-whitespace invalid base64 character is encountered and the parameter "strict" is true, then this function will throw a std::runtime_error. If "strict" is false, the character is silently ignored.

Parameters
datainput data to decode
sizesize of input data to decode
strictthrow exception on invalid character
Returns
decoded binary data

Definition at line 108 of file base64.cpp.

Referenced by tlx::base64_decode().

◆ base64_decode() [2/2]

std::string base64_decode ( const std::string &  str,
bool  strict = true 
)

Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data.

If a non-whitespace invalid base64 character is encountered and the parameter "strict" is true, then this function will throw a std::runtime_error. If "strict" is false, the character is silently ignored.

Parameters
strinput string to encode
strictthrow exception on invalid character
Returns
decoded binary data

Definition at line 203 of file base64.cpp.

References tlx::base64_decode().

◆ base64_encode() [1/2]

std::string base64_encode ( const void *  data,
size_t  size,
size_t  line_break = 0 
)

Encode the given binary data into base64 representation as described in RFC 2045 or RFC 3548.

The output string contains only characters [A-Za-z0-9+/] and is roughly 33% longer than the input. The output string can be broken into lines after n characters, where n must be a multiple of 4.

Parameters
datainput data to encode
sizesize of input data to encode
line_breakbreak the output string every n characters
Returns
base64 encoded string

Definition at line 25 of file base64.cpp.

Referenced by tlx::base64_encode().

◆ base64_encode() [2/2]

std::string base64_encode ( const std::string &  str,
size_t  line_break = 0 
)

Encode the given binary string into base64 representation as described in RFC 2045 or RFC 3548.

The output string contains only characters [A-Za-z0-9+/] and is roughly 33% longer than the input. The output string can be broken into lines after n characters, where n must be a multiple of 4.

Parameters
strinput string to encode
line_breakbreak the output string every n characters
Returns
base64 encoded string

Definition at line 102 of file base64.cpp.

References tlx::base64_encode().

◆ bitdump_be8() [1/2]

std::string bitdump_be8 ( const void *const  data,
size_t  size 
)

Dump a (binary) string as a sequence of 8-bit big-endian bytes.

Parameters
databinary data to output as bits
sizelength of binary data
Returns
string of binary digits

Definition at line 51 of file bitdump.cpp.

Referenced by tlx::bitdump_be8(), tlx::bitdump_be8_type(), and tlx::bitdump_le8_type().

◆ bitdump_be8() [2/2]

std::string bitdump_be8 ( const std::string &  str)

Dump a (binary) string as a sequence of 8-bit big-endian bytes.

Parameters
strbinary data to output as bits
Returns
string of binary digits

Definition at line 77 of file bitdump.cpp.

References tlx::bitdump_be8().

◆ bitdump_be8_type()

std::string tlx::bitdump_be8_type ( const Type &  t)

Dump a (binary) item as a sequence of 8-bit big-endian bytes.

Parameters
tbinary data to output as bits
Returns
string of binary digits

Definition at line 81 of file bitdump.hpp.

References tlx::bitdump_be8().

◆ bitdump_le8() [1/2]

std::string bitdump_le8 ( const void *const  data,
size_t  size 
)

Dump a (binary) string as a sequence of 8-bit little-endian bytes.

Parameters
databinary data to output as bits
sizelength of binary data
Returns
string of binary digits

Definition at line 18 of file bitdump.cpp.

Referenced by tlx::bitdump_le8(), and tlx::bitdump_le8_type().

◆ bitdump_le8() [2/2]

std::string bitdump_le8 ( const std::string &  str)

Dump a (binary) string as a sequence of 8-bit little-endian bytes.

Parameters
strbinary data to output as bits
Returns
string of binary digits

Definition at line 44 of file bitdump.cpp.

References tlx::bitdump_le8().

◆ bitdump_le8_type()

std::string tlx::bitdump_le8_type ( const Type &  t)

Dump a (binary) item as a sequence of 8-bit little-endian bytes.

Parameters
tbinary data to output as bits
Returns
string of binary digits

Definition at line 51 of file bitdump.hpp.

References tlx::bitdump_be8(), and tlx::bitdump_le8().

◆ compare_icase() [1/4]

int compare_icase ( const char *  a,
const char *  b 
)

returns +1/0/-1 like strcmp(a, b) but without regard for letter case

Definition at line 18 of file compare_icase.cpp.

References tlx::to_lower().

◆ compare_icase() [2/4]

int compare_icase ( const char *  a,
const std::string &  b 
)

returns +1/0/-1 like strcmp(a, b) but without regard for letter case

Definition at line 35 of file compare_icase.cpp.

References tlx::to_lower().

◆ compare_icase() [3/4]

int compare_icase ( const std::string &  a,
const char *  b 
)

returns +1/0/-1 like strcmp(a, b) but without regard for letter case

Definition at line 54 of file compare_icase.cpp.

References tlx::to_lower().

◆ compare_icase() [4/4]

int compare_icase ( const std::string &  a,
const std::string &  b 
)

returns +1/0/-1 like strcmp(a, b) but without regard for letter case

Definition at line 72 of file compare_icase.cpp.

References tlx::to_lower().

◆ contains() [1/3]

bool contains ( const std::string &  str,
const std::string &  pattern 
)

Tests of string contains pattern.

Definition at line 15 of file contains.cpp.

◆ contains() [2/3]

bool contains ( const std::string &  str,
const char *  pattern 
)

Tests of string contains pattern.

Definition at line 19 of file contains.cpp.

◆ contains() [3/3]

bool contains ( const std::string &  str,
const char  ch 
)

Tests of string contains character.

Definition at line 23 of file contains.cpp.

◆ contains_word() [1/2]

bool contains_word ( const std::string &  str,
const char *  word 
)

Search the given string for a whitespace-delimited word.

It works as if the str was split_words() and the resulting vector checked for a given word. However this function does not create a vector, it scans the string directly. Whitespace is space, tab, newline or carriage-return.

Parameters
strwhitespace-delimited string to check
wordword to find
Returns
true if the word was found

Definition at line 19 of file contains_word.cpp.

References tlx::is_white().

Referenced by tlx::union_words().

◆ contains_word() [2/2]

bool contains_word ( const std::string &  str,
const std::string &  word 
)

Search the given string for a whitespace-delimited word.

It works as if the str was split_words() and the resulting vector checked for a given word. However this function does not create a vector, it scans the string directly. Whitespace is space, tab, newline or carriage-return.

Parameters
strwhitespace-delimited string to check
wordword to find
Returns
true if the word was found

Definition at line 55 of file contains_word.cpp.

References tlx::is_white().

◆ ends_with() [1/4]

bool ends_with ( const char *  str,
const char *  match 
)

Checks if the given match string is located at the end of this string.

Definition at line 22 of file ends_with.cpp.

Referenced by thrill::vfs::IsCompressed(), thrill::vfs::OpenReadStream(), thrill::vfs::OpenWriteStream(), thrill::vfs::SysOpenReadStream(), and thrill::vfs::SysOpenWriteStream().

◆ ends_with() [2/4]

bool ends_with ( const char *  str,
const std::string &  match 
)

Checks if the given match string is located at the end of this string.

Definition at line 38 of file ends_with.cpp.

◆ ends_with() [3/4]

bool ends_with ( const std::string &  str,
const char *  match 
)

Checks if the given match string is located at the end of this string.

Definition at line 53 of file ends_with.cpp.

◆ ends_with() [4/4]

bool ends_with ( const std::string &  str,
const std::string &  match 
)

Checks if the given match string is located at the end of this string.

Definition at line 66 of file ends_with.cpp.

◆ ends_with_icase() [1/2]

bool ends_with_icase ( const std::string &  str,
const char *  match 
)

Checks if the given match string is located at the end of this string.

Compares the characters case-insensitively.

Checks if the given match string is located at the end of this string. Compares the characters case-insensitively.

Checks if the given match string is located at the end of this string. Compares the characters case-insensitively.

Definition at line 106 of file ends_with.cpp.

References tlx::to_lower().

◆ ends_with_icase() [2/2]

bool ends_with_icase ( const std::string &  str,
const std::string &  match 
)

Checks if the given match string is located at the end of this string.

Compares the characters case-insensitively.

Definition at line 119 of file ends_with.cpp.

References tlx::to_lower().

◆ equal_icase() [1/4]

bool equal_icase ( const char *  a,
const char *  b 
)

returns true if a == b without regard for letter case

Definition at line 18 of file equal_icase.cpp.

References tlx::to_lower().

Referenced by tlx::index_of_icase().

◆ equal_icase() [2/4]

bool equal_icase ( const char *  a,
const std::string &  b 
)

returns true if a == b without regard for letter case

Definition at line 26 of file equal_icase.cpp.

References tlx::to_lower().

◆ equal_icase() [3/4]

bool equal_icase ( const std::string &  a,
const char *  b 
)

returns true if a == b without regard for letter case

Definition at line 35 of file equal_icase.cpp.

References tlx::to_lower().

◆ equal_icase() [4/4]

bool equal_icase ( const std::string &  a,
const std::string &  b 
)

returns true if a == b without regard for letter case

Definition at line 44 of file equal_icase.cpp.

References tlx::to_lower().

◆ erase_all() [1/6]

std::string & erase_all ( std::string *  str,
char  drop = ' ' 
)

Remove all occurrences of the given character in-place.

Parameters
strstring to process
dropremove this character
Returns
reference to the modified string

Definition at line 18 of file erase_all.cpp.

Referenced by tlx::erase_all().

◆ erase_all() [2/6]

std::string & erase_all ( std::string *  str,
const char *  drop 
)

Remove all occurrences of the given characters in-place.

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 34 of file erase_all.cpp.

◆ erase_all() [3/6]

std::string & erase_all ( std::string *  str,
const std::string &  drop 
)

Remove all occurrences of the given characters in-place.

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 50 of file erase_all.cpp.

References tlx::erase_all().

◆ erase_all() [4/6]

std::string erase_all ( const std::string &  str,
char  drop = ' ' 
)

Remove all occurrences of the given character, return copy of string.

Parameters
strstring to process
dropremove this character
Returns
copy of string possibly with less characters

Definition at line 57 of file erase_all.cpp.

◆ erase_all() [5/6]

std::string erase_all ( const std::string &  str,
const char *  drop 
)

Remove all occurrences of the given characters, return copy of string.

Parameters
strstring to process
dropremove these characters
Returns
copy of string possibly with less characters

Definition at line 71 of file erase_all.cpp.

◆ erase_all() [6/6]

std::string erase_all ( const std::string &  str,
const std::string &  drop 
)

Remove all occurrences of the given characters, return copy of string.

Parameters
strstring to process
dropremove these characters
Returns
copy of string possibly with less characters

Definition at line 92 of file erase_all.cpp.

References tlx::erase_all().

◆ escape_html() [1/2]

std::string escape_html ( const std::string &  str)

Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities.

Definition at line 17 of file escape_html.cpp.

◆ escape_html() [2/2]

std::string escape_html ( const char *  str)

Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities.

Definition at line 33 of file escape_html.cpp.

◆ escape_uri() [1/2]

std::string escape_uri ( const std::string &  str)

Escape a string into a URI-encoding.

This maps all non A-Z0-9 characters to HH hex representation.

Definition at line 17 of file escape_uri.cpp.

◆ escape_uri() [2/2]

std::string escape_uri ( const char *  str)

Escape a string into a URI-encoding.

This maps all non A-Z0-9 characters to HH hex representation.

Definition at line 57 of file escape_uri.cpp.

◆ expand_environment_variables() [1/3]

std::string & expand_environment_variables ( std::string *  s)

Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.

Matches all substrings "$[a-zA-Z_][a-zA-Z0-9_]*" and "${[^}]*}". Replaces all substrings in-place.

Definition at line 19 of file expand_environment_variables.cpp.

Referenced by tlx::expand_environment_variables(), and disk_config::parse_line().

◆ expand_environment_variables() [2/3]

std::string expand_environment_variables ( const std::string &  s)

Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.

Matches all substrings "$[a-zA-Z_][a-zA-Z0-9_]*" and "${[^}]*}". Returns a copy of the string with all substrings replaced.

Definition at line 80 of file expand_environment_variables.cpp.

References tlx::expand_environment_variables().

◆ expand_environment_variables() [3/3]

std::string expand_environment_variables ( const char *  s)

Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.

Matches all substrings "$[a-zA-Z_][a-zA-Z0-9_]*" and "${[^}]*}". Returns a copy of the string with all substrings replaced.

Definition at line 86 of file expand_environment_variables.cpp.

References tlx::expand_environment_variables().

◆ extract_between() [1/4]

std::string extract_between ( const std::string &  str,
const char *  sep1,
const char *  sep2 
)

Search the string for given start and end separators and extract all characters between the both, if they are found.

Otherwise return an empty string.

Parameters
strstring to search in
sep1start boundary
sep2end boundary

Definition at line 37 of file extract_between.cpp.

References tlx::extract_between_template().

◆ extract_between() [2/4]

std::string extract_between ( const std::string &  str,
const char *  sep1,
const std::string &  sep2 
)

Search the string for given start and end separators and extract all characters between the both, if they are found.

Otherwise return an empty string.

Parameters
strstring to search in
sep1start boundary
sep2end boundary

Definition at line 42 of file extract_between.cpp.

References tlx::extract_between_template().

◆ extract_between() [3/4]

std::string extract_between ( const std::string &  str,
const std::string &  sep1,
const char *  sep2 
)

Search the string for given start and end separators and extract all characters between the both, if they are found.

Otherwise return an empty string.

Parameters
strstring to search in
sep1start boundary
sep2end boundary

Definition at line 47 of file extract_between.cpp.

References tlx::extract_between_template().

◆ extract_between() [4/4]

std::string extract_between ( const std::string &  str,
const std::string &  sep1,
const std::string &  sep2 
)

Search the string for given start and end separators and extract all characters between the both, if they are found.

Otherwise return an empty string.

Parameters
strstring to search in
sep1start boundary
sep2end boundary

Definition at line 52 of file extract_between.cpp.

References tlx::extract_between_template().

◆ format_iec_units()

std::string format_iec_units ( uint64_t  number,
int  precision = 3 
)

Format number as something like 1 TiB.

Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of two). Returns "123 Ki" or similar.

Definition at line 38 of file format_si_iec_units.cpp.

Referenced by foxxll::add_IEC_binary_multiplier(), Context::Launch(), main(), MemoryConfig::print(), scoped_print_iostats::report(), and scoped_print_timer::~scoped_print_timer().

◆ format_si_units()

std::string format_si_units ( uint64_t  number,
int  precision = 3 
)

Format number as something like 1 TB.

Format a byte size using SI (K, M, G, T) suffixes (powers of ten). Returns "123 M" or similar.

Definition at line 19 of file format_si_iec_units.cpp.

Referenced by foxxll::add_SI_multiplier().

◆ hash_djb2() [1/5]

static uint32_t tlx::hash_djb2 ( const unsigned char *  str)
inlinestatic

Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 26 of file hash_djb2.hpp.

Referenced by MultiTimer::find_or_create(), tlx::hash_djb2(), hash< tlx::StringView >::operator()(), and MultiTimer::start().

◆ hash_djb2() [2/5]

static uint32_t tlx::hash_djb2 ( const char *  str)
inlinestatic

Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 41 of file hash_djb2.hpp.

References tlx::hash_djb2().

◆ hash_djb2() [3/5]

static uint32_t tlx::hash_djb2 ( const unsigned char *  str,
size_t  size 
)
inlinestatic

Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 50 of file hash_djb2.hpp.

◆ hash_djb2() [4/5]

static uint32_t tlx::hash_djb2 ( const char *  str,
size_t  size 
)
inlinestatic

Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 64 of file hash_djb2.hpp.

References tlx::hash_djb2().

◆ hash_djb2() [5/5]

static uint32_t tlx::hash_djb2 ( const std::string &  str)
inlinestatic

Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 73 of file hash_djb2.hpp.

References tlx::hash_djb2().

◆ hash_sdbm() [1/5]

static uint32_t tlx::hash_sdbm ( const unsigned char *  str)
inlinestatic

Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 26 of file hash_sdbm.hpp.

Referenced by tlx::hash_sdbm().

◆ hash_sdbm() [2/5]

static uint32_t tlx::hash_sdbm ( const char *  str)
inlinestatic

Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 40 of file hash_sdbm.hpp.

References tlx::hash_sdbm().

◆ hash_sdbm() [3/5]

static uint32_t tlx::hash_sdbm ( const unsigned char *  str,
size_t  size 
)
inlinestatic

Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 49 of file hash_sdbm.hpp.

◆ hash_sdbm() [4/5]

static uint32_t tlx::hash_sdbm ( const char *  str,
size_t  size 
)
inlinestatic

Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 63 of file hash_sdbm.hpp.

References tlx::hash_sdbm().

◆ hash_sdbm() [5/5]

static uint32_t tlx::hash_sdbm ( const std::string &  str)
inlinestatic

Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.

Definition at line 72 of file hash_sdbm.hpp.

References tlx::hash_sdbm().

◆ hexdump() [1/4]

std::string hexdump ( const void *const  data,
size_t  size 
)

Dump a (binary) string as a sequence of uppercase hexadecimal pairs.

Parameters
databinary data to output in hex
sizelength of binary data
Returns
string of hexadecimal pairs

Definition at line 21 of file hexdump.cpp.

Referenced by StreamSink::AppendPinnedBlock(), MD5::digest_hex_uc(), SHA1::digest_hex_uc(), SHA512::digest_hex_uc(), SHA256::digest_hex_uc(), tlx::hexdump(), tlx::hexdump_type(), Group::MaybeHexdump(), Socket::MaybeHexdump(), and CatStreamData::OnStreamBlock().

◆ hexdump() [2/4]

std::string hexdump ( const std::string &  str)

Dump a (binary) string as a sequence of uppercase hexadecimal pairs.

Parameters
strbinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 42 of file hexdump.cpp.

References tlx::hexdump().

◆ hexdump() [3/4]

std::string hexdump ( const std::vector< char > &  data)

Dump a char vector as a sequence of uppercase hexadecimal pairs.

Parameters
databinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 46 of file hexdump.cpp.

References tlx::hexdump().

◆ hexdump() [4/4]

std::string hexdump ( const std::vector< uint8_t > &  data)

Dump a uint8_t vector as a sequence of uppercase hexadecimal pairs.

Parameters
databinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 50 of file hexdump.cpp.

References tlx::hexdump().

◆ hexdump_lc() [1/4]

std::string hexdump_lc ( const void *const  data,
size_t  size 
)

Dump a (binary) string as a sequence of lowercase hexadecimal pairs.

Parameters
databinary data to output in hex
sizelength of binary data
Returns
string of hexadecimal pairs

Definition at line 95 of file hexdump.cpp.

Referenced by MD5::digest_hex(), SHA1::digest_hex(), SHA512::digest_hex(), SHA256::digest_hex(), tlx::hexdump_lc(), tlx::hexdump_lc_type(), and tlx::hexdump_type().

◆ hexdump_lc() [2/4]

std::string hexdump_lc ( const std::string &  str)

Dump a (binary) string as a sequence of lowercase hexadecimal pairs.

Parameters
strbinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 116 of file hexdump.cpp.

References tlx::hexdump_lc().

◆ hexdump_lc() [3/4]

std::string hexdump_lc ( const std::vector< char > &  data)

Dump a char vector as a sequence of lowercase hexadecimal pairs.

Parameters
databinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 120 of file hexdump.cpp.

References tlx::hexdump_lc().

◆ hexdump_lc() [4/4]

std::string hexdump_lc ( const std::vector< uint8_t > &  data)

Dump a uint8_t vector as a sequence of lowercase hexadecimal pairs.

Parameters
databinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 124 of file hexdump.cpp.

References tlx::hexdump_lc().

◆ hexdump_lc_type()

std::string tlx::hexdump_lc_type ( const Type &  t)

Dump a (binary) item as a sequence of lowercase hexadecimal pairs.

Parameters
tbinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 110 of file hexdump.hpp.

References tlx::hexdump_lc(), and tlx::parse_hexdump().

◆ hexdump_sourcecode()

std::string hexdump_sourcecode ( const std::string &  str,
const std::string &  var_name = "name" 
)

Dump a (binary) string into a C source code snippet.

The snippet defines an array of const uint8_t* holding the data of the string.

Parameters
strstring to output as C source array
var_namename of the array variable in the outputted code snippet
Returns
string holding C source snippet

Definition at line 54 of file hexdump.cpp.

Referenced by tlx::hexdump_type().

◆ hexdump_type()

std::string tlx::hexdump_type ( const Type &  t)

Dump a (binary) item as a sequence of uppercase hexadecimal pairs.

Parameters
tbinary data to output in hex
Returns
string of hexadecimal pairs

Definition at line 52 of file hexdump.hpp.

References tlx::hexdump(), tlx::hexdump_lc(), and tlx::hexdump_sourcecode().

Referenced by BlockReader< CatBlockSource >::Next(), SSTreeBuilderPreAndLevelOrder< key_type, num_splitters >::recurse(), and SSTreeBuilderLevelOrder< key_type, num_splitters >::recurse().

◆ index_of() [1/2]

size_t index_of ( const std::vector< std::string > &  list,
const char *  str 
)

Attempts to find str in the list and return the index.

Throws a std::runtime_error if it is not found.

Definition at line 19 of file index_of.cpp.

◆ index_of() [2/2]

size_t index_of ( const std::vector< std::string > &  list,
const std::string &  str 
)

Attempts to find str in the list and return the index.

Throws a std::runtime_error if it is not found.

Definition at line 29 of file index_of.cpp.

◆ index_of_icase() [1/2]

size_t index_of_icase ( const std::vector< std::string > &  list,
const char *  str 
)

Attempts to find str in the list and return the index using case-insensitive comparisons.

Throws a std::runtime_error if it is not found.

Definition at line 39 of file index_of.cpp.

References tlx::equal_icase().

◆ index_of_icase() [2/2]

size_t index_of_icase ( const std::vector< std::string > &  list,
const std::string &  str 
)

Attempts to find str in the list and return the index using case-insensitive comparisons.

Throws a std::runtime_error if it is not found.

Definition at line 50 of file index_of.cpp.

References tlx::equal_icase().

◆ join() [1/7]

std::string join ( char  glue,
const std::vector< std::string > &  parts 
)

Join a vector of strings by some glue character between each pair from the sequence.

Parameters
gluecharacter for glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 16 of file join.cpp.

Referenced by tlx::join(), thrill::data::operator<<(), examples::page_rank::PageRank(), examples::page_rank::PageRankJoin(), tlx::parallel_multiway_merge_base(), ByteBlock::pin_count_str(), ReadBinaryNode< ValueType >::ReadBinaryNode(), ReadLinesNode::ReadLinesNode(), and ThreadPool::~ThreadPool().

◆ join() [2/7]

std::string join ( const char *  glue,
const std::vector< std::string > &  parts 
)

Join a vector of strings by some glue string between each pair from the sequence.

Parameters
gluestring to glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 20 of file join.cpp.

References tlx::join().

◆ join() [3/7]

std::string join ( const std::string &  glue,
const std::vector< std::string > &  parts 
)

Join a vector of strings by some glue string between each pair from the sequence.

Parameters
gluestring to glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 24 of file join.cpp.

References tlx::join().

◆ join() [4/7]

static std::string tlx::join ( Glue  glue,
Iterator  first,
Iterator  last 
)
inlinestatic

Join a sequence of strings by some glue string between each pair from the sequence.

The sequence in given as a range between two iterators.

Parameters
gluestring to glue
firstthe beginning iterator of the range to join
lastthe ending iterator of the range to join
Returns
string constructed from the range with the glue between two strings.

Definition at line 35 of file join_generic.hpp.

◆ join() [5/7]

static std::string tlx::join ( char  glue,
const Container &  parts 
)
inlinestatic

Join a Container of strings by some glue character between each pair from the sequence.

Parameters
gluecharacter for glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 62 of file join_generic.hpp.

References tlx::join().

◆ join() [6/7]

static std::string tlx::join ( const char *  glue,
const Container &  parts 
)
inlinestatic

Join a Container of strings by some glue string between each pair from the sequence.

Parameters
gluestring to glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 76 of file join_generic.hpp.

References tlx::join().

◆ join() [7/7]

static std::string tlx::join ( const std::string &  glue,
const Container &  parts 
)
inlinestatic

Join a Container of strings by some glue string between each pair from the sequence.

Parameters
gluestring to glue
partsthe vector of strings to join
Returns
string constructed from the vector with the glue between two strings

Definition at line 90 of file join_generic.hpp.

References tlx::join().

◆ join_quoted() [1/2]

std::string join_quoted ( const std::vector< std::string > &  str,
char  sep,
char  quote,
char  escape 
)

Join a vector of strings using a separator character.

If any string contains the separator, quote the field. In the quoted string, escape all quotes, escapes, \n, \r, \t sequences. This is the opposite of split_quoted().

Definition at line 15 of file join_quoted.cpp.

Referenced by tlx::join_quoted().

◆ join_quoted() [2/2]

std::string join_quoted ( const std::vector< std::string > &  str)

Join a vector of strings using spaces as separator character.

If any string contains a space, quote the field. In the quoted string, escape all quotes, escapes, \n, \r, \t sequences. This is the opposite of split_quoted().

Definition at line 55 of file join_quoted.cpp.

References tlx::join_quoted().

◆ less_icase() [1/4]

bool less_icase ( const char *  a,
const char *  b 
)

returns true if a < b without regard for letter case

Definition at line 18 of file less_icase.cpp.

References tlx::to_lower().

Referenced by less_icase_asc::operator()(), and less_icase_desc::operator()().

◆ less_icase() [2/4]

bool less_icase ( const char *  a,
const std::string &  b 
)

returns true if a < b without regard for letter case

Definition at line 33 of file less_icase.cpp.

References tlx::to_lower().

◆ less_icase() [3/4]

bool less_icase ( const std::string &  a,
const char *  b 
)

returns true if a < b without regard for letter case

Definition at line 49 of file less_icase.cpp.

References tlx::to_lower().

◆ less_icase() [4/4]

bool less_icase ( const std::string &  a,
const std::string &  b 
)

returns true if a < b without regard for letter case

Definition at line 65 of file less_icase.cpp.

References tlx::to_lower().

◆ levenshtein() [1/2]

static size_t tlx::levenshtein ( const char *  a,
const char *  b 
)
inlinestatic

Computes the Levenshtein string distance between two strings.

The distance is the minimum number of replacements/inserts/deletes needed to change one string into the other.

Parameters
afirst string
bsecond string
Returns
Levenshtein distance

Definition at line 128 of file levenshtein.hpp.

◆ levenshtein() [2/2]

static size_t tlx::levenshtein ( const std::string &  a,
const std::string &  b 
)
inlinestatic

Computes the Levenshtein string distance between two strings.

The distance is the minimum number of replacements/inserts/deletes needed to change one string into the other.

Parameters
afirst string
bsecond string
Returns
Levenshtein distance

Definition at line 156 of file levenshtein.hpp.

◆ levenshtein_algorithm()

static size_t tlx::levenshtein_algorithm ( const char *  a,
size_t  a_size,
const char *  b,
size_t  b_size 
)
inlinestatic

Computes the Levenshtein string distance also called edit distance between two strings.

The distance is the minimum number of replacements/inserts/deletes needed to change one string into the other. Implemented with time complexity O(|n|+|m|) and memory complexity O(2*max(|n|,|m|))

Parameters
afirst string
a_sizesize of first string
bsecond string
b_sizesize of second string
Returns
Levenshtein distance

Definition at line 67 of file levenshtein.hpp.

References min(), and tlx::swap().

◆ levenshtein_icase() [1/2]

static size_t tlx::levenshtein_icase ( const char *  a,
const char *  b 
)
inlinestatic

Computes the Levenshtein string distance between two strings.

The distance is the minimum number of replacements/inserts/deletes needed to change one string into the other.

Parameters
afirst string
bsecond string
Returns
Levenshtein distance

Definition at line 142 of file levenshtein.hpp.

◆ levenshtein_icase() [2/2]

static size_t tlx::levenshtein_icase ( const std::string &  a,
const std::string &  b 
)
inlinestatic

Computes the Levenshtein string distance between two strings.

The distance is the minimum number of replacements/inserts/deletes needed to change one string into the other. Character comparison is done case-insensitively.

Parameters
afirst string
bsecond string
Returns
Levenshtein distance

Definition at line 171 of file levenshtein.hpp.

◆ pad()

std::string pad ( const std::string &  s,
size_t  len,
char  pad_char 
)

Truncate or pad string to exactly len characters.

Definition at line 15 of file pad.cpp.

◆ parse_hexdump()

std::string parse_hexdump ( const std::string &  str)

Read a string as a sequence of hexadecimal pairs.

Converts each pair of hexadecimal digits into a byte of the output string. Throws std::runtime_error() if an unknown letter is encountered.

Parameters
strstring to parse as hex digits
Returns
string of read bytes

Definition at line 131 of file hexdump.cpp.

Referenced by tlx::hexdump_lc_type().

◆ parse_si_iec_units() [1/2]

bool parse_si_iec_units ( const char *  str,
uint64_t *  out_size,
char  default_unit = 0 
)

Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes.

Returns the number of bytes and sets ok = true if the string could be parsed correctly. If no units indicator is given, use def_unit in k/m/g/t/p (powers of ten) or in K/M/G/T/P (power of two).

Definition at line 17 of file parse_si_iec_units.cpp.

Referenced by main(), disk_config::parse_line(), tlx::parse_si_iec_units(), and MemoryConfig::setup_detect().

◆ parse_si_iec_units() [2/2]

bool parse_si_iec_units ( const std::string &  str,
uint64_t *  out_size,
char  default_unit = 0 
)

Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes.

Returns the number of bytes and sets ok = true if the string could be parsed correctly. If no units indicator is given, use def_unit in k/m/g/t/p (powers of ten) or in K/M/G/T/P (power of two).

Definition at line 88 of file parse_si_iec_units.cpp.

References tlx::parse_si_iec_units().

◆ replace_all() [1/10]

std::string & replace_all ( std::string *  str,
const std::string &  needle,
const std::string &  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 141 of file replace.cpp.

Referenced by thrill::common::LogCmdlineParams().

◆ replace_all() [2/10]

std::string & replace_all ( std::string *  str,
const std::string &  needle,
const char *  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 154 of file replace.cpp.

◆ replace_all() [3/10]

std::string & replace_all ( std::string *  str,
const char *  needle,
const std::string &  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 168 of file replace.cpp.

◆ replace_all() [4/10]

std::string & replace_all ( std::string *  str,
const char *  needle,
const char *  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 182 of file replace.cpp.

◆ replace_all() [5/10]

std::string & replace_all ( std::string *  str,
char  needle,
char  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlecharacter to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 197 of file replace.cpp.

◆ replace_all() [6/10]

std::string replace_all ( const std::string &  str,
const std::string &  needle,
const std::string &  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. Returns a copy of the string with possible replacements.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacements

Definition at line 212 of file replace.cpp.

◆ replace_all() [7/10]

std::string replace_all ( const std::string &  str,
const std::string &  needle,
const char *  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. Returns a copy of the string with possible replacements.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacements

Definition at line 227 of file replace.cpp.

◆ replace_all() [8/10]

std::string replace_all ( const std::string &  str,
const char *  needle,
const std::string &  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. Returns a copy of the string with possible replacements.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacements

Definition at line 242 of file replace.cpp.

◆ replace_all() [9/10]

std::string replace_all ( const std::string &  str,
const char *  needle,
const char *  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. Returns a copy of the string with possible replacements.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacements

Definition at line 257 of file replace.cpp.

◆ replace_all() [10/10]

std::string replace_all ( const std::string &  str,
char  needle,
char  instead 
)

Replace all occurrences of needle in str.

Each needle will be replaced with instead, if found. Returns a copy of the string with possible replacements.

Parameters
strthe string to process
needlecharacter to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacements

Definition at line 273 of file replace.cpp.

◆ replace_first() [1/10]

std::string & replace_first ( std::string *  str,
const std::string &  needle,
const std::string &  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 21 of file replace.cpp.

◆ replace_first() [2/10]

std::string & replace_first ( std::string *  str,
const std::string &  needle,
const char *  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 32 of file replace.cpp.

◆ replace_first() [3/10]

std::string & replace_first ( std::string *  str,
const char *  needle,
const std::string &  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 43 of file replace.cpp.

◆ replace_first() [4/10]

std::string & replace_first ( std::string *  str,
const char *  needle,
const char *  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 54 of file replace.cpp.

◆ replace_first() [5/10]

std::string & replace_first ( std::string *  str,
char  needle,
char  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. The replacement is done in the given string and a reference to the same is returned.

Parameters
strthe string to process
needlecharacter to search for in str
insteadreplace needle with instead
Returns
reference to str

Definition at line 65 of file replace.cpp.

◆ replace_first() [6/10]

std::string replace_first ( const std::string &  str,
const std::string &  needle,
const std::string &  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. Returns a copy of the string with the possible replacement.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacement

Definition at line 78 of file replace.cpp.

◆ replace_first() [7/10]

std::string replace_first ( const std::string &  str,
const std::string &  needle,
const char *  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. Returns a copy of the string with the possible replacement.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacement

Definition at line 91 of file replace.cpp.

◆ replace_first() [8/10]

std::string replace_first ( const std::string &  str,
const char *  needle,
const std::string &  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. Returns a copy of the string with the possible replacement.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacement

Definition at line 103 of file replace.cpp.

◆ replace_first() [9/10]

std::string replace_first ( const std::string &  str,
const char *  needle,
const char *  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. Returns a copy of the string with the possible replacement.

Parameters
strthe string to process
needlestring to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacement

Definition at line 115 of file replace.cpp.

◆ replace_first() [10/10]

std::string replace_first ( const std::string &  str,
char  needle,
char  instead 
)

Replace only the first occurrence of needle in str.

The needle will be replaced with instead, if found. Returns a copy of the string with the possible replacement.

Parameters
strthe string to process
needlecharacter to search for in str
insteadreplace needle with instead
Returns
copy of string possibly with replacement

Definition at line 127 of file replace.cpp.

◆ split() [1/12]

std::vector< std::string > split ( char  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator character into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
sepseparator character
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 20 of file split.cpp.

Referenced by tlx::multiway_merge_detail::equally_split(), BTree< key_type, value_type, key_of_value, key_compare, traits, true, allocator_type >::insert_descend(), JoinTPCH4(), tlx::parallel_mergesort_base(), disk_config::parse_fileio(), disk_config::parse_line(), Percentiles(), tlx::multiway_merge_detail::prepare_unguarded(), tlx::multiway_merge_detail::prepare_unguarded_sentinel(), thrill::api::RunBackendLoopback(), and tlx::split().

◆ split() [2/12]

std::vector< std::string > split ( const char *  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
sepseparator string
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 28 of file split.cpp.

References tlx::split().

◆ split() [3/12]

std::vector< std::string > split ( const std::string &  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
sepseparator string
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 36 of file split.cpp.

References tlx::split().

◆ split() [4/12]

std::vector< std::string > split ( char  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator character into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
sepseparator string
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 47 of file split.cpp.

References tlx::split().

◆ split() [5/12]

std::vector< std::string > split ( const char *  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
sepseparator string
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 56 of file split.cpp.

References tlx::split().

◆ split() [6/12]

std::vector< std::string > split ( const std::string &  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
sepseparator string
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 65 of file split.cpp.

References tlx::split().

◆ split() [7/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
char  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator character into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
intodestination std::vector
sepseparator character
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 77 of file split.cpp.

◆ split() [8/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
const char *  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
intodestination std::vector
sepseparator string
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 147 of file split.cpp.

References tlx::split().

◆ split() [9/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
const std::string &  sep,
const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
intodestination std::vector
sepseparator string
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 155 of file split.cpp.

References tlx::split().

◆ split() [10/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
char  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator character into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
intodestination std::vector
sepseparator character
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 166 of file split.cpp.

References tlx::split().

◆ split() [11/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
const char *  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
intodestination std::vector
sepseparator string
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 179 of file split.cpp.

References tlx::split().

◆ split() [12/12]

std::vector< std::string > & split ( std::vector< std::string > *  into,
const std::string &  sep,
const std::string &  str,
std::string::size_type  min_fields,
std::string::size_type  limit 
)

Split the given string at each separator string into distinct substrings.

Multiple consecutive separators are considered individually and will result in empty split substrings. Returns a vector of strings with at least min_fields and at most limit_fields, empty fields are added if needed.

Parameters
intodestination std::vector
sepseparator string
strstring to split
min_fieldsminimum number of parts returned
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 192 of file split.cpp.

References tlx::split().

◆ split_quoted() [1/2]

std::vector< std::string > split_quoted ( const std::string &  str,
char  sep,
char  quote,
char  escape 
)

Split the given string at each separator character into distinct substrings.

Multiple separators are joined and will not result in empty split substrings. Quoted fields extend to the next quote. Quoted fields may containg escaped quote, and \n \r \t \\ sequences.

Definition at line 18 of file split_quoted.cpp.

Referenced by tlx::split_quoted().

◆ split_quoted() [2/2]

std::vector< std::string > split_quoted ( const std::string &  str)

Split the given string at each space into distinct substrings.

Multiple spaces are joined and will not result in empty split substrings. Quoted fields extend to the next quote. Quoted fields may containg escaped quote, and \n \r \t \\ sequences.

Definition at line 122 of file split_quoted.cpp.

References tlx::split_quoted().

◆ split_view()

static void tlx::split_view ( char  sep,
const std::string &  str,
Functor &&  callback,
std::string::size_type  limit = std::string::npos 
)
inlinestatic

Split the given string at each separator character into distinct substrings, and call the given callback with a StringView for each substring.

Multiple consecutive separators are considered individually and will result in empty split substrings.

Parameters
strstring to split
sepseparator character
callbackcallback taking StringView of substring
limitmaximum number of parts returned

Definition at line 38 of file split_view.hpp.

Referenced by examples::word_count::HashWordCountExample(), main(), WordCount(), and examples::word_count::WordCount().

◆ split_words()

std::vector< std::string > split_words ( const std::string &  str,
std::string::size_type  limit = std::string::npos 
)

Split the given string by whitespaces into distinct words.

Multiple consecutive whitespaces are considered as one split point. Whitespaces are space, tab, newline and carriage-return.

Parameters
strstring to split
limitmaximum number of parts returned
Returns
vector containing each split substring

Definition at line 15 of file split_words.cpp.

◆ ssnprintf()

std::string std::string ssnprintf ( size_t  max_size,
const char *  fmt,
  ... 
)

Helper for return the result of a snprintf() call inside a std::string.

Parameters
max_sizemaximum length of output string, longer ones are truncated.
fmtprintf format and additional parameters

Definition at line 42 of file ssprintf.cpp.

Referenced by thrill::vfs::FillFilePattern().

◆ ssnprintf_generic()

String tlx::ssnprintf_generic ( size_t  max_size,
const char *  fmt,
  ... 
)

Helper for return the result of a snprintf() call inside a string object.

Parameters
max_sizemaximum length of output string, longer ones are truncated.
fmtprintf format and additional parameters

Referenced by tlx::ssprintf_generic().

◆ ssprintf()

std::string ssprintf ( const char *  fmt,
  ... 
)

Helper for return the result of a sprintf() call inside a std::string.

Parameters
fmtprintf format and additional parameters

Definition at line 18 of file ssprintf.cpp.

Referenced by examples::suffix_sorting::ConstructWaveletTree(), RunJoinPageRankEdgePerLine(), RunPageRankEdgePerLine(), and RunPageRankJoinGenerated().

◆ ssprintf_generic()

String tlx::ssprintf_generic ( const char *  fmt,
  ... 
)

Helper for return the result of a sprintf() call inside a string object.

Parameters
fmtprintf format and additional parameters

◆ starts_with() [1/4]

bool starts_with ( const char *  str,
const char *  match 
)

Checks if the given match string is located at the start of this string.

Definition at line 21 of file starts_with.cpp.

Referenced by thrill::vfs::Glob(), thrill::vfs::IsRemoteUri(), thrill::vfs::OpenReadStream(), and thrill::vfs::OpenWriteStream().

◆ starts_with() [2/4]

bool starts_with ( const char *  str,
const std::string &  match 
)

Checks if the given match string is located at the start of this string.

Definition at line 29 of file starts_with.cpp.

◆ starts_with() [3/4]

bool starts_with ( const std::string &  str,
const char *  match 
)

Checks if the given match string is located at the start of this string.

Definition at line 38 of file starts_with.cpp.

◆ starts_with() [4/4]

bool starts_with ( const std::string &  str,
const std::string &  match 
)

Checks if the given match string is located at the start of this string.

Definition at line 47 of file starts_with.cpp.

◆ starts_with_icase() [1/4]

bool starts_with_icase ( const char *  str,
const char *  match 
)

Checks if the given match string is located at the start of this string.

Compares the characters case-insensitively.

Definition at line 55 of file starts_with.cpp.

References tlx::to_lower().

◆ starts_with_icase() [2/4]

bool starts_with_icase ( const char *  str,
const std::string &  match 
)

Checks if the given match string is located at the start of this string.

Compares the characters case-insensitively.

Definition at line 64 of file starts_with.cpp.

References tlx::to_lower().

◆ starts_with_icase() [3/4]

bool starts_with_icase ( const std::string &  str,
const char *  match 
)

Checks if the given match string is located at the start of this string.

Compares the characters case-insensitively.

Definition at line 73 of file starts_with.cpp.

References tlx::to_lower().

◆ starts_with_icase() [4/4]

bool starts_with_icase ( const std::string &  str,
const std::string &  match 
)

Checks if the given match string is located at the start of this string.

Compares the characters case-insensitively.

Definition at line 83 of file starts_with.cpp.

References tlx::to_lower().

◆ to_lower() [1/3]

char to_lower ( char  ch)

Transform the given character to lower case without any localization.

Definition at line 17 of file to_lower.cpp.

Referenced by LevenshteinStandardICaseParameters::char_equal(), tlx::compare_icase(), tlx::ends_with_icase(), tlx::equal_icase(), tlx::less_icase(), tlx::starts_with_icase(), and tlx::to_lower().

◆ to_lower() [2/3]

std::string & to_lower ( std::string *  str)

Transforms the given string to lowercase and returns a reference to it.

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 23 of file to_lower.cpp.

References tlx::to_lower().

◆ to_lower() [3/3]

std::string to_lower ( const std::string &  str)

Returns a copy of the given string converted to lowercase.

Parameters
strstring to process
Returns
new string lowercased

Definition at line 29 of file to_lower.cpp.

References tlx::to_lower().

◆ to_upper() [1/3]

char to_upper ( char  ch)

Transform the given character to upper case without any localization.

Definition at line 17 of file to_upper.cpp.

Referenced by tlx::to_upper().

◆ to_upper() [2/3]

std::string & to_upper ( std::string *  str)

Transforms the given string to uppercase and returns a reference to it.

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 23 of file to_upper.cpp.

References tlx::to_upper().

◆ to_upper() [3/3]

std::string to_upper ( const std::string &  str)

Returns a copy of the given string converted to uppercase.

Parameters
strstring to process
Returns
new string uppercased

Definition at line 29 of file to_upper.cpp.

References tlx::to_upper().

◆ trim() [1/6]

std::string & trim ( std::string *  str)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 20 of file trim.cpp.

Referenced by tlx::trim().

◆ trim() [2/6]

std::string & trim ( std::string *  str,
const char *  drop 
)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 24 of file trim.cpp.

◆ trim() [3/6]

std::string & trim ( std::string *  str,
const std::string &  drop 
)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 37 of file trim.cpp.

◆ trim() [4/6]

std::string trim ( const std::string &  str)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 50 of file trim.cpp.

References tlx::trim().

◆ trim() [5/6]

std::string trim ( const std::string &  str,
const char *  drop 
)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 54 of file trim.cpp.

◆ trim() [6/6]

std::string trim ( const std::string &  str,
const std::string &  drop 
)

Trims the given string in-place on the left and right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 70 of file trim.cpp.

◆ trim_left() [1/6]

std::string & trim_left ( std::string *  str)

Trims the given string in-place only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 128 of file trim.cpp.

Referenced by tlx::trim_left().

◆ trim_left() [2/6]

std::string & trim_left ( std::string *  str,
const char *  drop 
)

Trims the given string in-place only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 132 of file trim.cpp.

◆ trim_left() [3/6]

std::string & trim_left ( std::string *  str,
const std::string &  drop 
)

Trims the given string in-place only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 137 of file trim.cpp.

◆ trim_left() [4/6]

std::string trim_left ( const std::string &  str)

Trims the given string only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
Returns
new trimmed string

Definition at line 142 of file trim.cpp.

References tlx::trim_left().

◆ trim_left() [5/6]

std::string trim_left ( const std::string &  str,
const char *  drop 
)

Trims the given string only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
dropremove these characters
Returns
new trimmed string

Definition at line 146 of file trim.cpp.

◆ trim_left() [6/6]

std::string trim_left ( const std::string &  str,
const std::string &  drop 
)

Trims the given string only on the left.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
dropremove these characters
Returns
new trimmed string

Definition at line 153 of file trim.cpp.

◆ trim_right() [1/6]

std::string & trim_right ( std::string *  str)

Trims the given string in-place only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
Returns
reference to the modified string

Definition at line 94 of file trim.cpp.

Referenced by tlx::trim_right().

◆ trim_right() [2/6]

std::string & trim_right ( std::string *  str,
const char *  drop 
)

Trims the given string in-place only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 98 of file trim.cpp.

◆ trim_right() [3/6]

std::string & trim_right ( std::string *  str,
const std::string &  drop 
)

Trims the given string in-place only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t".

Parameters
strstring to process
dropremove these characters
Returns
reference to the modified string

Definition at line 103 of file trim.cpp.

◆ trim_right() [4/6]

std::string trim_right ( const std::string &  str)

Trims the given string only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
Returns
new trimmed string

Definition at line 108 of file trim.cpp.

References tlx::trim_right().

◆ trim_right() [5/6]

std::string trim_right ( const std::string &  str,
const char *  drop 
)

Trims the given string only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
dropremove these characters
Returns
new trimmed string

Definition at line 112 of file trim.cpp.

◆ trim_right() [6/6]

std::string trim_right ( const std::string &  str,
const std::string &  drop 
)

Trims the given string only on the right.

Removes all characters in the given drop array, which defaults to " \r\n\t". Returns a copy of the string.

Parameters
strstring to process
dropremove these characters
Returns
new trimmed string

Definition at line 119 of file trim.cpp.

◆ union_words()

std::string union_words ( const std::string &  wordsA,
const std::string &  wordsB 
)

Return union of two keyword sets.

Definition at line 16 of file union_words.cpp.

References tlx::contains_word().

◆ word_wrap()

std::string word_wrap ( const std::string &  str,
unsigned int  wrap = 80 
)

Try to wrap a string to 80 columns without split words.

All newlines are kept, new newline characters are inserted only at spaces, hence, words are never split. If words longer than 80 columns occur they are NOT broken.

Definition at line 22 of file word_wrap.cpp.

References tlx::is_space().