libi2ncommon: (gerd) merge escape into stringfunc
[libi2ncommon] / src / stringfunc.hxx
1 /***************************************************************************
2  *   Copyright (C) 2004 by Gerd v. Egidy                                   *
3  *   info@intra2net.com                                                    *
4  *                                                                         *
5  ***************************************************************************/
6
7 #ifndef __STRINGFUNC_HXX
8 #define __STRINGFUNC_HXX
9
10 #include <string>
11
12 std::string to_lower (const std::string &src);
13 std::string to_upper (const std::string &src);
14
15 std::string nice_unit_format (int input);
16
17 bool replace_all(std::string &base, const std::string *ist, const std::string *soll);
18 bool replace_all(std::string &base, const char *ist, const char *soll);
19 bool replace_all(std::string &base, const char *ist, const std::string *soll);
20 bool replace_all(std::string &base, const std::string &ist, const char *soll);
21 bool replace_all(std::string &base, const std::string &ist, const std::string &soll);
22
23 std::string iso_to_utf8(const std::string& isostring);
24 std::string utf8_to_iso(const std::string& utf8string);
25 std::string iso_to_html(const std::string& isostring);
26
27 std::string escape(const std::string &s);
28
29 std::string descape(const std::string &s, int startpos, int &endpos);
30 std::string descape(const std::string &s)
31 {
32     int endpos;
33     return descape(s,0,endpos);
34 }
35
36 std::string escape_shellarg(const std::string &input);
37
38 #endif