File indexing completed on 2025-01-18 09:39:15
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 country_;
0025 std::string encoding_;
0026 std::string variant_;
0027 bool utf8_;
0028
0029 public:
0030
0031 locale_data();
0032
0033
0034
0035 explicit locale_data(const std::string& locale_name);
0036
0037
0038 const std::string& language() const { return language_; }
0039
0040 const std::string& country() const { return country_; }
0041
0042 const std::string& encoding() const { return encoding_; }
0043
0044
0045 locale_data& encoding(std::string new_encoding, bool uppercase = true);
0046
0047 const std::string& variant() const { return variant_; }
0048
0049 bool is_utf8() const { return utf8_; }
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 bool parse(const std::string& locale_name);
0060
0061
0062
0063 std::string to_string() const;
0064
0065 private:
0066 void reset();
0067 bool parse_from_lang(const std::string& input);
0068 bool parse_from_country(const std::string& input);
0069 bool parse_from_encoding(const std::string& input);
0070 bool parse_from_variant(const std::string& input);
0071 };
0072
0073 }}}
0074
0075 #ifdef BOOST_MSVC
0076 # pragma warning(pop)
0077 #endif
0078 #endif