LiteSQL  0.3.10
string.hpp
Go to the documentation of this file.
1 /* LiteSQL
2  *
3  * The list of contributors at http://litesql.sf.net/
4  *
5  * See LICENSE for copyright information. */
6 
9 #ifndef litesql_string_hpp
10 #define litesql_string_hpp
11 
12 #include <string>
13 #include <sstream>
14 namespace litesql {
17 template <class T>
18 std::string toString(T a) {
19  std::ostringstream ost;
20  ost << a;
21  return ost.str();
22 }
23 
25 bool startsWith(const std::string& what, const std::string& with);
27 bool endsWith(const std::string& what, const std::string& with);
29 std::string toLower(std::string s);
31 std::string toUpper(std::string s);
32 
33 std::string capitalize(const std::string& s);
34 std::string decapitalize(const std::string& s);
35 
36 
38 std::string rstrip(std::string s);
40 std::string lstrip(std::string s);
42 std::string replace(const std::string& s, const std::string& what, const std::string& with);
44 int hexToInt(const std::string& s);
46 int atoi(const std::string &s);
48 std::string operator*(int amount, const std::string &s);
50 std::string operator*(const std::string &s, int amount);
53 std::string escapeSQL(const std::string &str);
54 }
55 
56 #endif
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
Definition: backend.hpp:14
std::string toString(T a)
returns string representation of passed parameter if it can be written to ostringstream ...
Definition: string.hpp:18

SourceForge.net Logo