Databaseconnectionclasses  0.5.3
hk_string.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_STRING
12 #define HK_STRING
13 #include <string>
14 using namespace std;
24  typedef std::basic_string <char> hk_string;
25 // typedef basic_string <wchar_t> wstring;
26 
27 
28 extern "C"
29 {
30  hk_string smallstringconversion(const hk_string & what, const hk_string& from, const hk_string& to);
31  hk_string l2u(const hk_string& what,const hk_string& locale="");
32  hk_string u2l(const hk_string& what,const hk_string& locale="");
33  hk_string string2upper(const hk_string& what);
34  hk_string string2lower(const hk_string& what);
35 
36 }
37 
38 
46 hk_string format_number(double value,bool separator=true,int digits=2,const hk_string& locale="");
47 hk_string format_number(const hk_string& value,bool is_locale, bool separator,int digits,const hk_string& locale);
48 
56 hk_string format_standard_number(double value,bool separator=false,int digits=8,const hk_string& standardlocale="C");
57 hk_string format_standard_number(const hk_string& value,bool separator=false,int digits=8,const hk_string& standardlocale="C");
58 
62 double localestring2double(const hk_string& localenumberstring);
63 
64 long int localestring2int(const hk_string& localenumberstring);
65 long unsigned int localestring2uint(const hk_string& localenumberstring);
66 
70 double standardstring2double(const hk_string& standardnumberstring,const hk_string& standardlocale="C");
74 long int standardstring2int(const hk_string& standardnumberstring,const hk_string& standardlocale="C");
78 hk_string longint2string(long int value);
82 hk_string ulongint2string(unsigned long int value);
90 hk_string replace_all(const hk_string& what,const hk_string& where,const hk_string& with);
91 
92 
93 hk_string trimleft(const hk_string&);
94 hk_string trimright(const hk_string&);
95 hk_string trim(const hk_string&);
96 hk_string bin2hex(char n);
97 char hex2bin(const hk_string&);
98 
99 #endif