CUBRID Engine  latest
locale_helper.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * locale_helper.hpp
21  */
22 
23 #ifndef _LOCALE_HELPER_HPP_
24 #define _LOCALE_HELPER_HPP_
25 
26 #include "language_support.h"
27 #include "intl_support.h"
28 
29 #include <locale>
30 #include <codecvt>
31 #include <string>
32 
33 /* TODO: need to make compatible fully between CUBRID Language support and cpp standard locale */
34 namespace cublocale
35 {
36  std::string get_lang_name (const LANG_COLLATION *lang_coll);
37  std::string get_codeset_name (const LANG_COLLATION *lang_coll);
38  std::locale get_locale (const std::string &charset, const std::string &lang);
39 
40  bool convert_to_wstring (std::wstring &out, const std::string &in, const INTL_CODESET codeset);
41  bool convert_to_string (std::string &out, const std::wstring &in, const INTL_CODESET codeset);
42 }
43 
44 #endif /* _LOCALE_HELPER_HPP_ */
std::string get_lang_name(const LANG_COLLATION *lang_coll)
std::string get_codeset_name(const LANG_COLLATION *lang_coll)
std::locale get_locale(const std::string &charset, const std::string &lang)
bool convert_to_string(std::string &out, const std::wstring &in, const INTL_CODESET codeset)
enum intl_codeset INTL_CODESET
Definition: intl_support.h:190
bool convert_to_wstring(std::wstring &out, const std::string &in, const INTL_CODESET codeset)