#ifndef LSTRINGS_H
#define LSTRINGS_H
+#ifdef __GNUG__
+#pragma interface
+#endif
+
#include <cstring>
#include <cctype>
#ifdef HAVE_SSTREAM
#include <sstream>
-using std::ostringstream;
#else
#include <strstream>
#endif
///
int compare_no_case(string const & s, string const & s2, unsigned int len);
-///
-inline int compare(char const * a, char const * b)
+
+inline
+int compare(char const * a, char const * b)
{
return strcmp(a, b);
}
-///
-inline int compare(char const * a, char const * b, unsigned int len)
+
+inline
+int compare(char const * a, char const * b, unsigned int len)
{
return strncmp(a, b, len);
}
///
int strToInt(string const & str);
+///
+bool isStrDbl(string const & str);
+
+///
+double strToDbl(string const & str);
+
+///
+char lowercase(char c);
+
+///
+char uppercase(char c);
+
///
string lowercase(string const &);
///
string uppercase(string const &);
-/// convert T to string
+// convert T to string
template<typename T>
-inline string tostr(T const & t)
+inline
+string tostr(T const & t)
{
#ifdef HAVE_SSTREAM
- ostringstream ostr;
+ std::ostringstream ostr;
ostr << t;
return ostr.str().c_str();
// We need to use the .c_str since we sometimes are using
// our own string class and that is not compatible with
- // basic_string<char>.
+ // basic_string<char>. (of course we don't want this later)
#else
// The buf is probably a bit large, but if we want to be safer
// we should leave it this big. As compiler/libs gets updated
///
bool contains(char const * a, char const * b);
+///
+bool containsOnly(string const &, char const *);
+
+///
+bool containsOnly(string const &, string const &);
+
+///
+bool containsOnly(char const *, char const *);
+
+///
+bool containsOnly(char const *, string const &);
+
/// Counts how many of character c there is in a
unsigned int countChar(string const & a, char const c);