ddc
ddcLocale.h
Go to the documentation of this file.
1 /* -*- Mode: C++ -*- */
2 // DDC originally by Alexey Sokirko
3 // Changes and modifications 2011-2015 by Bryan Jurish
4 //
5 // This file is part of DDC.
6 //
7 // DDC is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // DDC is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with DDC. If not, see <http://www.gnu.org/licenses/>.
19 //
20 
21 /*--------------------------------------------------------------------------
22  * File: ddcLocale.h
23  * Author: Bryan Jurish <jurish@uni-potsdam.de>
24  * Description: locale interface
25  *--------------------------------------------------------------------------*/
26 
32 #ifndef _DDC_LOCALE_H
33 #define _DDC_LOCALE_H
34 
35 #include <locale.h>
36 #include <string>
37 
39 extern bool ddcLocaleInitialized;
40 
42 extern void ddcInitLocale(void);
43 
46 std::wstring string2wstring(const std::string &src);
47 
50 std::string wstring2string(const std::wstring &src);
51 
53 std::wstring wstoupper(const std::wstring &ws);
54 
56 std::wstring wstolower(const std::wstring &ws);
57 
59 std::string stoupper(const std::string &s);
60 
62 std::string stolower(const std::string &s);
63 
64 #endif //_DDC_LOCALE_H
65 
66 /*--- emacs style variables ---
67  * Local Variables:
68  * mode: C++
69  * c-file-style: "ellemtel"
70  * c-basic-offset: 4
71  * tab-width: 8
72  * indent-tabs-mode: nil
73  * End:
74  */
void ddcInitLocale(void)
initialize the locale from current environment if not already initialized
Definition: ddcLocale.cpp:31
std::wstring wstoupper(const std::wstring &ws)
convert a std::wstring to upper-case
Definition: ddcLocale.cpp:106
std::wstring wstolower(const std::wstring &ws)
convert a std::wstring to lower-case
Definition: ddcLocale.cpp:117
std::string wstring2string(const std::wstring &src)
Definition: ddcLocale.cpp:81
std::wstring string2wstring(const std::string &src)
Definition: ddcLocale.cpp:43
bool ddcLocaleInitialized
sentinel indicating whether current process has initialized the locale
Definition: ddcLocale.cpp:28
std::string stoupper(const std::string &s)
convert a std::string to upper-case according to current locale (implicit conversion to and from wstr...
Definition: ddcLocale.cpp:128
std::string stolower(const std::string &s)
convert a std::string to lower-case according to current locale (implicit conversion to and from stri...
Definition: ddcLocale.cpp:134