20extern CGV_API
const char*
skip_spaces(
const char* begin,
const char* end);
22extern CGV_API
const char*
cutoff_spaces(
const char* begin,
const char* end);
24extern CGV_API std::string&
ltrim(std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
26extern CGV_API std::string&
rtrim(std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
28extern CGV_API std::string&
trim(std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
30extern CGV_API std::string
ltrim(
const std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
32extern CGV_API std::string
rtrim(
const std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
34extern CGV_API std::string
trim(
const std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
36extern CGV_API std::string
join(
const std::vector<std::string>::const_iterator first,
const std::vector<std::string>::const_iterator last,
const std::string& sep,
bool trailing_sep =
false);
38extern CGV_API std::string
join(
const std::vector<std::string>&strs,
const std::string & sep,
bool trailing_sep =
false);
40extern CGV_API std::string
join(
const std::vector<token>::const_iterator first,
const std::vector<token>::const_iterator last,
const std::string& sep,
bool trailing_sep =
false);
52extern CGV_API std::string
to_hex(uint8_t v,
bool use_upper_case =
true);
54extern CGV_API uint8_t
from_hex(
char c);
56extern CGV_API std::vector<uint8_t>
parse_hex_bytes(
const std::string& byte_str);
58extern CGV_API std::string
to_lower(
const std::string& _s);
62extern CGV_API std::string
to_upper(
const std::string& _s);
64extern CGV_API std::string&
remove(std::string& s,
char c);
66extern CGV_API std::string
remove_copy(
const std::string& s,
char c);
70extern CGV_API
unsigned int replace(std::string& _s,
char c1,
char c2);
72extern CGV_API
unsigned int replace(std::string& _s,
const std::string& s1,
const std::string& s2);
78extern CGV_API
bool find_name(
const std::string& s,
const char* names[],
int& idx);
80extern CGV_API
bool is_element(
char c,
const std::string& s);
82extern CGV_API
bool is_element(
const std::string& e,
const std::string& s,
char sep =
';');
85extern CGV_API
int get_element_index(
const std::string& e,
const std::string& s,
char sep =
';');
87extern CGV_API std::string
get_element(
const std::string& s,
int element_index,
char sep =
';');
89extern CGV_API
bool is_integer(
const char* begin,
const char* end,
int& value);
91extern CGV_API
bool is_integer(
const std::string& s,
int& value);
93extern CGV_API
bool is_double(
const char* begin,
const char* end,
double& value);
95extern CGV_API
bool is_double(
const std::string& s,
double& value);
97extern CGV_API
bool is_year(
const char* begin,
const char* end,
unsigned short& year,
bool short_allowed =
true);
99extern CGV_API
bool is_year(
const std::string& s,
unsigned short& year,
bool short_allowed =
true);
101extern CGV_API
bool is_day(
const char* begin,
const char* end,
unsigned char& day);
103extern CGV_API
bool is_day(
const std::string& s,
unsigned char& day);
105extern CGV_API
bool is_month(
const char* begin,
const char* end,
unsigned char& month);
107extern CGV_API
bool is_month(
const std::string& s,
unsigned char& month);
117extern CGV_API
bool is_url(
const char* begin,
const char* end,
const char** new_end = 0);
119extern CGV_API
bool is_url(
const std::string& s,
const char** end = 0);
126#include <cgv/config/lib_end.h>
bool is_digit(char c)
check if char is a digit
unsigned int replace(std::string &s, char c1, char c2)
replace char c1 with c2 in the given string _s and return number of replacements
std::string to_hex(uint8_t v, bool use_upper_case)
convert to hex
std::string get_element(const std::string &s, int element_index, char sep)
interpret s as a list separated by sep and return the element with the given element index.
bool is_url(const std::string &s, const char **end)
check and extract end of valid url from string s
std::string & rtrim(std::string &str, const std::string &chars)
trim white space or other characters from end of string
std::string interpret_special(const std::string &s)
interprets the C++ special characters \a, \b, \f, \n, \r, \t, \v, \\', \", \\, \?,...
bool is_integer(const char *begin, const char *end, int &value)
check if the text range (begin,end( defines an integer value. If yes, store the value in the passed r...
std::string escape_special(const std::string &s)
escapes the C++ special characters \a, \b, \f, \n, \r, \t, \v, \\', \", \\, \?
bool is_month(const char *begin, const char *end, unsigned char &month)
check and extract month from string token [begin, end]
std::string & trim(std::string &str, const std::string &chars)
trim white space or other characters from start and end of string
bool is_year(const char *begin, const char *end, unsigned short &year, bool short_allowed)
check and extract year from string token [begin, end]
std::string & ltrim(std::string &str, const std::string &chars)
trim white space or other characters from start of string
bool is_url_special(char c)
check if char is a special character from an url
char to_lower(char c)
convert char to lower case
bool is_date(const std::string &s, cgv::utils::date &d, const char **new_end)
check and extract date from string s
char to_upper(char c)
convert char to upper case
std::string remove_copy(const std::string &s, char c)
return a copy of the given string s with all occurences of char removed
bool is_space(char c)
check if char is a whitespace
bool find_name(const std::string &s, const char *names[], int &idx)
check if string s is contained in the given array of names and in case of success store name index in...
std::string join(const std::vector< std::string >::const_iterator first, const std::vector< std::string >::const_iterator last, const std::string &sep, bool trailing_sep)
joins a given range of strings, separating them by the given separator; if trailing_sep is true,...
std::string replace_special(const std::string &_s)
replaces the german special characters ä,ö,ü,ß,Ä,Ö,Ü
CGV_API bool is_day(const char *begin, const char *end, unsigned char &day)
check and extract day from string token [begin, end]
bool is_letter(char c)
check if char is a letter
bool is_double(const char *begin, const char *end, double &value)
check if the text range (begin,end( defines a double value. If yes, store the value in the passed ref...
bool is_time(const std::string &s, cgv::utils::time &t, const char **new_end)
check and extract time from string s
bool is_element(char c, const std::string &s)
check if char c arises in string s
const char * cutoff_spaces(const char *begin, const char *end)
return new end pointer by cutting off spaces at the end
uint8_t from_hex(char c)
convert from hex character
std::string & remove(std::string &s, char c)
remove char c from the given string s and return a reference to the same string object
int get_element_index(const std::string &e, const std::string &s, char sep)
check if the string e is contained as element in the string s, which is a list separated by sep and r...
const char * skip_spaces(const char *begin, const char *end)
return new start pointer by skipping spaces at begin
std::vector< uint8_t > parse_hex_bytes(const std::string &byte_str)
parse bytes hex coded bytes
unsigned int levenshtein_distance(const std::string &s1, const std::string &s2)
compute the levenshtein distance between two strings s1 and s2