cgv
scan.h File Reference
#include <string>
#include "date_time.h"
#include "lib_begin.h"
#include <cgv/config/lib_end.h>

Go to the source code of this file.

Namespaces

 cgv
 the cgv namespace
 
 cgv::utils
 namespace that holds tools that dont fit any other namespace
 

Functions

const char * cgv::utils::skip_spaces (const char *begin, const char *end)
 return new start pointer by skipping spaces at begin
 
const char * cgv::utils::cutoff_spaces (const char *begin, const char *end)
 return new end pointer by cutting off spaces at the end
 
bool cgv::utils::is_space (char c)
 check if char is a whitespace
 
bool cgv::utils::is_url_special (char c)
 check if char is a special character from an url
 
bool cgv::utils::is_digit (char c)
 check if char is a digit
 
bool cgv::utils::is_letter (char c)
 check if char is a letter
 
char cgv::utils::to_lower (char c)
 convert char to lower case
 
std::string cgv::utils::to_hex (uint8_t v, bool use_upper_case=true)
 convert to hex
 
std::string cgv::utils::to_lower (const std::string &_s)
 convert string to lower case
 
char cgv::utils::to_upper (char c)
 convert char to upper case
 
std::string cgv::utils::to_upper (const std::string &_s)
 convert string to upper case
 
std::string cgv::utils::replace_special (const std::string &_s)
 replaces the german special characters ä,ö,ü,ß,Ä,Ö,Ü
 
unsigned int cgv::utils::replace (std::string &_s, char c1, char c2)
 replace char c1 with c2 in the given string _s and return number of replacements
 
unsigned int cgv::utils::replace (std::string &_s, const std::string &s1, const std::string &s2)
 replace string s1 with s2 in the given string _s and return number of replacements
 
std::string cgv::utils::interpret_special (const std::string &s)
 interprets the C++ special characters \a, \b, \f, \n, \r, \t, \v, \\', \", \\, \?, \ooo, \xhh
 
std::string cgv::utils::escape_special (const std::string &s)
 escapes the C++ special characters \a, \b, \f, \n, \r, \t, \v, \\', \", \\, \?
 
bool cgv::utils::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 idx
 
bool cgv::utils::is_element (char c, const std::string &s)
 check if char c arises in string s
 
bool cgv::utils::is_element (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
 
int cgv::utils::get_element_index (const std::string &e, const std::string &s, char sep)
 
std::string cgv::utils::get_element (const std::string &s, int element_index, char sep)
 
bool cgv::utils::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 reference.
 
bool cgv::utils::is_integer (const std::string &s, int &value)
 check if the passed string defines an integer value. If yes, store the value in the passed reference.
 
bool cgv::utils::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 reference.
 
bool cgv::utils::is_double (const std::string &s, double &value)
 check if the passed string defines a double value. If yes, store the value in the passed reference.
 
bool cgv::utils::is_year (const char *begin, const char *end, unsigned short &year, bool short_allowed=true)
 check and extract year from string token [begin, end]
 
bool cgv::utils::is_year (const std::string &s, unsigned short &year, bool short_allowed=true)
 check and extract year from string s
 
CGV_API bool cgv::utils::is_day (const char *begin, const char *end, unsigned char &day)
 check and extract day from string token [begin, end]
 
CGV_API bool cgv::utils::is_day (const std::string &s, unsigned char &day)
 check and extract day from string s
 
bool cgv::utils::is_month (const char *begin, const char *end, unsigned char &month)
 check and extract month from string token [begin, end]
 
bool cgv::utils::is_month (const std::string &s, unsigned char &month)
 check and extract month from string s
 
bool cgv::utils::is_time (const std::string &s, cgv::utils::time &t, const char **new_end=0)
 check and extract time from string token [begin, end]
 
bool cgv::utils::is_time (const char *begin, const char *end, cgv::utils::time &t, const char **new_end=0)
 check and extract time from string s
 
bool cgv::utils::is_date (const std::string &s, cgv::utils::date &d, const char **new_end=0)
 check and extract date from string token [begin, end]
 
bool cgv::utils::is_date (const char *begin, const char *end, cgv::utils::date &d, const char **new_end=0)
 check and extract date from string s
 
bool cgv::utils::is_url (const std::string &s, const char **end=0)
 check and extract end of valid url from string s
 
bool cgv::utils::is_url (const char *begin, const char *end, const char **new_end=0)
 check and extract end of valid url from string token [begin, end]
 

Detailed Description

Helper functions to process strings.