123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef BOOST_LOCALE_UTIL_LOCALE_DATA_HPP
- #define BOOST_LOCALE_UTIL_LOCALE_DATA_HPP
- #include <boost/locale/config.hpp>
- #include <string>
- #ifdef BOOST_MSVC
- # pragma warning(push)
- # pragma warning(disable : 4251)
- #endif
- namespace boost { namespace locale { namespace util {
-
- class BOOST_LOCALE_DECL locale_data {
- std::string language_;
- std::string country_;
- std::string encoding_;
- std::string variant_;
- bool utf8_;
- public:
-
- locale_data();
-
-
-
- explicit locale_data(const std::string& locale_name);
-
- const std::string& language() const { return language_; }
-
- const std::string& country() const { return country_; }
-
- const std::string& encoding() const { return encoding_; }
-
-
- locale_data& encoding(std::string new_encoding, bool uppercase = true);
-
- const std::string& variant() const { return variant_; }
-
- bool is_utf8() const { return utf8_; }
-
-
-
-
-
-
-
-
- bool parse(const std::string& locale_name);
-
-
- std::string to_string() const;
- private:
- void reset();
- bool parse_from_lang(const std::string& input);
- bool parse_from_country(const std::string& input);
- bool parse_from_encoding(const std::string& input);
- bool parse_from_variant(const std::string& input);
- };
- }}}
- #ifdef BOOST_MSVC
- # pragma warning(pop)
- #endif
- #endif
|