37 #ifndef VIGRA_BASICS_HXX
38 #define VIGRA_BASICS_HXX
42 #include "metaprogramming.hxx"
45 #include "mathutil.hxx"
55 doxygen_overloaded_function(template <class T> std::string
asString(T t))
57 #define VIGRA_AS_STRING(T) \
58 inline std::string asString(T t) \
60 std::stringstream s; \
66 VIGRA_AS_STRING(
signed char)
67 VIGRA_AS_STRING(
unsigned char)
68 VIGRA_AS_STRING(
signed short)
69 VIGRA_AS_STRING(
unsigned short)
70 VIGRA_AS_STRING(
signed long)
71 VIGRA_AS_STRING(
unsigned long)
72 VIGRA_AS_STRING(
signed long long)
73 VIGRA_AS_STRING(
unsigned long long)
74 VIGRA_AS_STRING(
signed int)
75 VIGRA_AS_STRING(
unsigned int)
76 VIGRA_AS_STRING(
float)
77 VIGRA_AS_STRING(
double)
78 VIGRA_AS_STRING(
long double)
79 VIGRA_AS_STRING(
void *)
81 #undef VIGRA_AS_STRING
84 std::string & operator<<(std::string & s, T
const & t)
95 for(
unsigned int k=0; k<s.size(); ++k)
96 s[k] = (std::string::value_type)std::tolower(s[k]);
100 inline std::string
tolower(
const char * s)
102 return tolower(std::string(s));
111 for(
unsigned int k=0; k<s.size(); ++k)
113 if(std::isspace(s[k]))
115 res += (std::string::value_type)std::tolower(s[k]);
129 template <
class T1,
class T2>
130 ostream & operator<<(ostream & s, std::pair<T1, T2>
const & p)
132 s <<
"(" << p.first <<
", " << p.second <<
")";
163 #endif // VIGRA_BASICS_HXX
std::string tolower(std::string s)
Definition: utilities.hxx:93
std::string asString(T t)(...)
std::string normalizeString(std::string const &s)
Definition: utilities.hxx:107