Image Component Library (ICL)
|
Classes | |
struct | icl::utils::MatchResult |
Utility structure for matching results. More... | |
Functions | |
template<class T > | |
std::ostream & | icl::utils::icl_to_stream (std::ostream &s, T t) |
compatibility function that writes a datatype instance into a stream | |
template<class T > | |
std::istream & | icl::utils::icl_from_stream (std::istream &s, T &t) |
compability function that reads a datatype instance from a stream | |
ICLUtils_API std::string & | icl::utils::toLowerI (std::string &s) |
inplace lower case conversion | |
ICLUtils_API std::string & | icl::utils::toUpperI (std::string &s) |
inplace upper case conversion | |
ICLUtils_API std::string | icl::utils::toLower (const std::string &s) |
lower case conversion | |
ICLUtils_API std::string | icl::utils::toUpper (const std::string &s) |
upper case conversion | |
ICLUtils_API std::vector < std::string > | icl::utils::tok (const std::string &s, const std::string &delims=" ", bool singleCharDelims=true, char escapeChar='\0') |
tokenizes a string with given delimiters (internally using a temporary StrTok instance) | |
ICLUtils_API std::vector < std::string > & | icl::utils::tok (const std::string &s, const std::string &delim, std::vector< std::string > &dst, bool singleCharDelims=true, char escapeChar='\0') |
tokenize a string with given delimiters into a result vector (optimized) | |
ICLUtils_API std::string | icl::utils::cat (const std::vector< std::string > &v) |
concatinates at string-vector to a single string | |
ICLUtils_API std::string | icl::utils::toStr (int i, const char *format, char *buf=0) |
creates a string from a given integer | |
ICLUtils_API std::string | icl::utils::toStr (double d, const char *format, char *buf=0) |
creates a string from a given double/float | |
ICLUtils_API std::string | icl::utils::toStr (int i, char *buf=0) |
create a string from given integer using format string "%d" | |
ICLUtils_API std::string | icl::utils::toStr (double d, char *buf=0) |
create a string from given float using format string "%f" | |
template<class T > | |
std::string | icl::utils::str (const T &t) |
convert a data type into a string using an std::ostringstream instance | |
template<class T > | |
std::string | icl::utils::cat (const std::vector< T > &v, const std::string &delim=",") |
creates a delim-separated string of str'ed values of given vector | |
template<class T > | |
T | icl::utils::parse (const std::string &s) |
parses a string into template parameter (defined for iclXX and std::string) | |
ICLUtils_API icl8u | icl::utils::to8u (const std::string &s) |
cast a string to an icl8u (parse) | |
ICLUtils_API icl16s | icl::utils::to16s (const std::string &s) |
cast a string to an icl16s (parse) | |
ICLUtils_API icl32s | icl::utils::to32s (const std::string &s) |
cast a string to an icl32ss (parse) | |
ICLUtils_API icl32f | icl::utils::to32f (const std::string &s) |
cast a string to an icl32f (parse) | |
ICLUtils_API icl64f | icl::utils::to64f (const std::string &s) |
cast a string to an icl64f (parse) | |
template<class T > | |
std::vector< T > | icl::utils::parseVec (const std::vector< std::string > &v) |
parse a vector of strings into a vector of T's | |
template<class T > | |
std::vector< T > | icl::utils::parseVecStr (const std::string &vecStr, const std::string &delims=",") |
parse a delims seperated string into a vector of T's | |
template<class T > | |
std::vector< std::string > | icl::utils::strVec (const std::vector< T > &v) |
convert a vector of T's into a vector of strings | |
ICLUtils_API MatchResult | icl::utils::match (const std::string &text, const std::string ®ex, int numSubMatches=0) throw (InvalidRegularExpressionException) |
Applies a regular expression match on given text and regex pattern (internally using regex.h) |
ICLUtils_API std::string icl::utils::cat | ( | const std::vector< std::string > & | v | ) |
concatinates at string-vector to a single string
std::string icl::utils::cat | ( | const std::vector< T > & | v, |
const std::string & | delim = "," |
||
) |
creates a delim-separated string of str'ed values of given vector
e.g. if v is {1,2,3} and delim is '-' the resulting string will be "1-2-3"
std::istream& icl::utils::icl_from_stream | ( | std::istream & | s, |
T & | t | ||
) | [inline] |
compability function that reads a datatype instance from a stream
This must be used, to ensure, icl8u data is read as (int) rather as char
std::ostream& icl::utils::icl_to_stream | ( | std::ostream & | s, |
T | t | ||
) | [inline] |
compatibility function that writes a datatype instance into a stream
This must be used, to ensure, icl8u data is shown as (int) rather as char
ICLUtils_API MatchResult icl::utils::match | ( | const std::string & | text, |
const std::string & | regex, | ||
int | numSubMatches = 0 |
||
) | throw (InvalidRegularExpressionException) |
Applies a regular expression match on given text and regex pattern (internally using regex.h)
text | source string |
regex | regular expression to search in text |
numSubMatches | If 0 (which is default, result contains only an information whether the match was successful or not. Sub matches can be recorded optionally using a numSubMatches value > 0. Please note, that the whole pattern match is submatches[0] in the resulting MatchResult if numSubMatches is at least 1 |
T icl::utils::parse | ( | const std::string & | s | ) | [inline] |
std::vector<T> icl::utils::parseVec | ( | const std::vector< std::string > & | v | ) | [inline] |
parse a vector of strings into a vector of T's
std::vector<T> icl::utils::parseVecStr | ( | const std::string & | vecStr, |
const std::string & | delims = "," |
||
) | [inline] |
parse a delims seperated string into a vector of T's
std::string icl::utils::str | ( | const T & | t | ) | [inline] |
convert a data type into a string using an std::ostringstream instance
std::vector<std::string> icl::utils::strVec | ( | const std::vector< T > & | v | ) | [inline] |
convert a vector of T's into a vector of strings
ICLUtils_API icl16s icl::utils::to16s | ( | const std::string & | s | ) |
cast a string to an icl16s (parse)
ICLUtils_API icl32f icl::utils::to32f | ( | const std::string & | s | ) |
cast a string to an icl32f (parse)
ICLUtils_API icl32s icl::utils::to32s | ( | const std::string & | s | ) |
cast a string to an icl32ss (parse)
ICLUtils_API icl64f icl::utils::to64f | ( | const std::string & | s | ) |
cast a string to an icl64f (parse)
ICLUtils_API icl8u icl::utils::to8u | ( | const std::string & | s | ) |
cast a string to an icl8u (parse)
ICLUtils_API std::vector<std::string> icl::utils::tok | ( | const std::string & | s, |
const std::string & | delims = " " , |
||
bool | singleCharDelims = true , |
||
char | escapeChar = '\0' |
||
) |
tokenizes a string with given delimiters (internally using a temporary StrTok instance)
ICLUtils_API std::vector<std::string>& icl::utils::tok | ( | const std::string & | s, |
const std::string & | delim, | ||
std::vector< std::string > & | dst, | ||
bool | singleCharDelims = true , |
||
char | escapeChar = '\0' |
||
) |
tokenize a string with given delimiters into a result vector (optimized)
ICLUtils_API std::string icl::utils::toLower | ( | const std::string & | s | ) |
lower case conversion
ICLUtils_API std::string& icl::utils::toLowerI | ( | std::string & | s | ) |
inplace lower case conversion
ICLUtils_API std::string icl::utils::toStr | ( | int | i, |
const char * | format, | ||
char * | buf = 0 |
||
) |
creates a string from a given integer
i | to be converted integer value |
format | format string as d or %8d |
buf | optinal dest buffer (used if not NULL) |
ICLUtils_API std::string icl::utils::toStr | ( | double | d, |
const char * | format, | ||
char * | buf = 0 |
||
) |
creates a string from a given double/float
d | to be converted double/float value |
format | format string as ff or %3.5f |
buf | optinal dest buffer (used if not NULL) |
ICLUtils_API std::string icl::utils::toStr | ( | int | i, |
char * | buf = 0 |
||
) |
create a string from given integer using format string "%d"
ICLUtils_API std::string icl::utils::toStr | ( | double | d, |
char * | buf = 0 |
||
) |
create a string from given float using format string "%f"
ICLUtils_API std::string icl::utils::toUpper | ( | const std::string & | s | ) |
upper case conversion
ICLUtils_API std::string& icl::utils::toUpperI | ( | std::string & | s | ) |
inplace upper case conversion