75 template<>
inline std::ostream &
icl_to_stream(std::ostream &s,
bool b){
79 template<>
inline std::istream &
icl_from_stream(std::istream &s,
bool &b){
101 ICLUtils_API std::vector<std::string>
tok(
const std::string &s,
const std::string &delims =
" ",
102 bool singleCharDelims=
true,
char escapeChar=
'\0');
105 ICLUtils_API std::vector<std::string> &
tok(
const std::string &s,
const std::string &delim, std::vector<std::string> &dst,
106 bool singleCharDelims=
true,
char escapeChar=
'\0');
136 inline std::string
str(
const T &t){
137 std::ostringstream s;
145 std::ostringstream s;
152 inline std::string
str(
const bool &b){
153 return b ?
"true" :
"false";
157 template<>
inline std::string
str(
const std::string &s) {
return s; }
160 template<>
inline std::string
str(
char*
const &pc) {
return pc; }
163 template<>
inline std::string
str(
const char*
const &pc) {
return pc; }
171 std::string
cat(
const std::vector<T> &v,
const std::string &delim =
","){
172 if(!v.size())
return "";
173 std::ostringstream s; s << v[0];
174 for(
unsigned int i=1;i<v.size();++i){ s << delim << v[i]; }
183 inline T
parse(
const std::string &s){
184 std::istringstream
str(s);
191 inline const char*
parse(
const std::string &s){
192 std::istringstream
str(s);
206 inline icl8u parse<icl8u>(
const std::string &s){
207 return parse_icl8u(s);
210 inline icl32f parse<icl32f>(
const std::string &s){
211 return parse_icl32f(s);
214 inline icl64f parse<icl64f>(
const std::string &s){
215 return parse_icl64f(s);
218 inline bool parse<bool>(
const std::string &s){
219 return parse_bool(s);
222 inline std::string parse<std::string>(
const std::string &s){
246 inline std::vector<T>
parseVec(
const std::vector<std::string> &v){
247 std::vector<T> r(v.size());
248 std::transform(v.begin(),v.end(),r.begin(),parse<T>);
254 inline std::vector<T>
parseVecStr(
const std::string &vecStr,
const std::string &delims =
","){
255 return parseVec<T>(
tok(vecStr,delims));
260 inline std::vector<std::string>
strVec(
const std::vector<T> &v){
261 std::vector<std::string> r(v.size());
262 std::transform(v.begin(),v.end(),r.begin(),str<T>);
316 ICLUtils_API void analyseHashes(
const std::string &sFileName,
unsigned int& nHashes, std::string::size_type& iPostfixPos);
int begin
Definition: StringUtils.h:273
ICLUtils_API MatchResult match(const std::string &text, const std::string ®ex, int numSubMatches=0)
Applies a regular expression match on given text and regex pattern (internally using regex....
ICLUtils_API icl32f to32f(const std::string &s)
cast a string to an icl32f (parse)
undocument this line if you encounter any issues!
Definition: Any.h:37
ICLUtils_API std::string toStr(int i, const char *format, char *buf=0)
creates a string from a given integer
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
ICLUtils_API std::string & toUpperI(std::string &s)
inplace upper case conversion
Utility structure for matching results.
Definition: StringUtils.h:269
ICLUtils_API std::string & toLowerI(std::string &s)
inplace lower case conversion
#define ICLUtils_API
this macros are important for creating dll's
Definition: CompatMacros.h:171
ICLQt_API void text(ImgQ &image, int x, int y, const string &text)
renders a text into an image (only available with Qt-Support)
std::vector< std::string > submatches
Definition: StringUtils.h:276
ICLUtils_API std::string cat(const std::vector< std::string > &v)
concatinates at string-vector to a single string
ICLUtils_API bool startsWith(const std::string &s, const std::string &prefix)
returns whether a given string begins with a given prefix
std::vector< T > parseVec(const std::vector< std::string > &v)
parse a vector of strings into a vector of T's
Definition: StringUtils.h:246
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
int64_t value_type
internal data type (64Bit integer)
Definition: Time.h:56
Ipp32s icl32s
32bit signed integer type for the ICL
Definition: BasicTypes.h:58
ICLUtils_API icl8u to8u(const std::string &s)
cast a string to an icl8u (parse)
Ipp32f icl32f
32Bit floating point type for the ICL
Definition: BasicTypes.h:55
ICLUtils_API bool endsWith(const std::string &s, const std::string &suffix)
returns whether a given string ends with a given suffix
ICLUtils_API std::string skipWhitespaces(const std::string &s)
crops trailing whitespaces of a string
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
std::ostream & icl_to_stream(std::ostream &s, T t)
compatibility function that writes a datatype instance into a stream
Definition: StringUtils.h:51
ICLUtils_API std::string toLower(const std::string &s)
lower case conversion
ICLUtils_API icl16s to16s(const std::string &s)
cast a string to an icl16s (parse)
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
bool matched
was the match successful
Definition: StringUtils.h:270
ICLUtils_API void analyseHashes(const std::string &sFileName, unsigned int &nHashes, std::string::size_type &iPostfixPos)
analyses a file pattern with hash-characters
std::vector< std::string > strVec(const std::vector< T > &v)
convert a vector of T's into a vector of strings
Definition: StringUtils.h:260
int end
Definition: StringUtils.h:274
T parse(const std::string &s)
parses a string into template parameter (defined for iclXX and std::string)
Definition: StringUtils.h:183
ICLUtils_API icl32s to32s(const std::string &s)
cast a string to an icl32ss (parse)
std::istream & icl_from_stream(std::istream &s, T &t)
compability function that reads a datatype instance from a stream
Definition: StringUtils.h:58
Ipp16s icl16s
16bit signed integer type for the ICL (range [-32767, 32768 ])
Definition: BasicTypes.h:61
ICLUtils_API std::string time2str(Time::value_type x)
converts a Time::value_type (long int) into a string
std::vector< T > parseVecStr(const std::string &vecStr, const std::string &delims=",")
parse a delims seperated string into a vector of T's
Definition: StringUtils.h:254
ICLUtils_API std::vector< std::string > 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::string toUpper(const std::string &s)
upper case conversion
ICLUtils_API icl64f to64f(const std::string &s)
cast a string to an icl64f (parse)
Definition: StringUtils.h:272