Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Namespaces | Functions
StringUtils.h File Reference
#include <ICLUtils/CompatMacros.h>
#include <ICLUtils/BasicTypes.h>
#include <ICLUtils/Exception.h>
#include <ICLUtils/Time.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <iostream>

Go to the source code of this file.

Classes

struct  icl::utils::MatchResult
 Utility structure for matching results. More...
struct  icl::utils::MatchResult::Match

Namespaces

namespace  icl
 

The ICL-namespace.


namespace  icl::utils

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<>
std::string icl::utils::str (const icl8u &t)
 specialized for icl8u
template<>
std::string icl::utils::str (const bool &b)
 specialized for bool
template<>
std::string icl::utils::str (const std::string &s)
 specialized for std::string input (this is quiet silly)
template<>
std::string icl::utils::str (char *const &pc)
 specialized for char const pointers
template<>
std::string icl::utils::str (const char *const &pc)
 specialized for const char const pointers
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 >
icl::utils::parse (const std::string &s)
 parses a string into template parameter (defined for iclXX and std::string)
template<>
const char * icl::utils::parse (const std::string &s)
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 &regex, 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::time2str (Time::value_type x)
 converts a Time::value_type (long int) into a string
ICLUtils_API std::string icl::utils::skipWhitespaces (const std::string &s)
 crops trailing whitespaces of a string
ICLUtils_API bool icl::utils::endsWith (const std::string &s, const std::string &suffix)
 returns whether a given string ends with a given suffix
ICLUtils_API bool icl::utils::startsWith (const std::string &s, const std::string &prefix)
 returns whether a given string begins with a given prefix
ICLUtils_API void icl::utils::analyseHashes (const std::string &sFileName, unsigned int &nHashes, std::string::size_type &iPostfixPos)
 analyses a file pattern with hash-characters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines