123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- #ifndef BOOST_LOCALE_INFO_HPP_INCLUDED
- #define BOOST_LOCALE_INFO_HPP_INCLUDED
- #include <boost/locale/config.hpp>
- #ifdef BOOST_MSVC
- # pragma warning(push)
- # pragma warning(disable : 4275 4251 4231 4660)
- #endif
- #include <locale>
- #include <string>
- namespace boost {
- namespace locale {
-
-
-
-
-
- class BOOST_LOCALE_DECL info : public std::locale::facet
- {
- public:
- static std::locale::id id;
-
-
-
- enum string_propery {
- language_property,
- country_property,
- variant_property,
- encoding_property,
- name_property
- };
-
-
-
- enum integer_property {
- utf8_property
- };
-
-
-
-
- info(size_t refs = 0) : std::locale::facet(refs)
- {
- }
-
-
-
- std::string language() const
- {
- return get_string_property(language_property);
- }
-
-
-
- std::string country() const
- {
- return get_string_property(country_property);
- }
-
-
-
- std::string variant() const
- {
- return get_string_property(variant_property);
- }
-
-
-
- std::string encoding() const
- {
- return get_string_property(encoding_property);
- }
-
-
-
- std::string name() const
- {
- return get_string_property(name_property);
- }
-
-
-
- bool utf8() const
- {
- return get_integer_property(utf8_property) != 0;
- }
-
- #if defined (__SUNPRO_CC) && defined (_RWSTD_VER)
- std::locale::id& __get_id (void) const { return id; }
- #endif
- protected:
-
-
-
- virtual std::string get_string_property(string_propery v) const = 0;
-
-
-
- virtual int get_integer_property(integer_property v) const = 0;
- };
- }
- }
- #ifdef BOOST_MSVC
- #pragma warning(pop)
- #endif
- #endif
|