File indexing completed on 2025-09-13 08:38:34
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_LOCALE_UTIL_LOCALE_DATA_HPP
0009 #define BOOST_LOCALE_UTIL_LOCALE_DATA_HPP
0010
0011 #include <boost/locale/config.hpp>
0012 #include <string>
0013
0014 #ifdef BOOST_MSVC
0015 # pragma warning(push)
0016 # pragma warning(disable : 4251)
0017 #endif
0018
0019 namespace boost { namespace locale { namespace util {
0020
0021
0022 class BOOST_LOCALE_DECL locale_data {
0023 std::string language_;
0024 std::string script_;
0025 std::string country_;
0026 std::string encoding_;
0027 std::string variant_;
0028 bool utf8_;
0029
0030 public:
0031
0032 locale_data();
0033
0034
0035
0036 explicit locale_data(const std::string& locale_name);
0037
0038
0039 const std::string& language() const { return language_; }
0040
0041 const std::string& script() const { return script_; }
0042
0043 const std::string& country() const { return country_; }
0044
0045 const std::string& encoding() const { return encoding_; }
0046
0047
0048 locale_data& encoding(std::string new_encoding, bool uppercase = true);
0049
0050 const std::string& variant() const { return variant_; }
0051
0052 bool is_utf8() const { return utf8_; }
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 bool parse(const std::string& locale_name);
0064
0065
0066
0067 std::string to_string() const;
0068
0069 private:
0070 void reset();
0071 bool parse_from_lang(const std::string& input);
0072 bool parse_from_script(const std::string& input);
0073 bool parse_from_country(const std::string& input);
0074 bool parse_from_encoding(const std::string& input);
0075 bool parse_from_variant(const std::string& input);
0076 };
0077
0078 }}}
0079
0080 #ifdef BOOST_MSVC
0081 # pragma warning(pop)
0082 #endif
0083 #endif