UnicodeCharsets.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #ifndef _UnicodeCharsets_h_
00031 #define _UnicodeCharsets_h_
00032
00033 #include <GG/Base.h>
00034
00035 #include <boost/cstdint.hpp>
00036
00037 #include <set>
00038
00039
00040 namespace GG {
00041
00048 struct GG_API UnicodeCharset
00049 {
00050 UnicodeCharset();
00051 UnicodeCharset(std::string script_name, boost::uint32_t first_char, boost::uint32_t last_char);
00052
00053 std::string m_script_name;
00054 boost::uint32_t m_first_char;
00055 boost::uint32_t m_last_char;
00056
00057 private:
00058 friend class boost::serialization::access;
00059 template <class Archive>
00060 void serialize(Archive& ar, const unsigned int version);
00061 };
00062
00064 GG_API bool operator==(const GG::UnicodeCharset& lhs, const GG::UnicodeCharset& rhs);
00065
00067 GG_API bool operator<(const GG::UnicodeCharset& lhs, const GG::UnicodeCharset& rhs);
00068
00069
00071 GG_API const std::vector<UnicodeCharset>& AllUnicodeCharsets();
00072
00074 GG_API std::set<UnicodeCharset> UnicodeCharsetsToRender(const std::string& str);
00075
00078 GG_API const UnicodeCharset* CharsetContaining(boost::uint32_t c);
00079
00082 GG_API const UnicodeCharset* CharsetWithName(const std::string& name);
00083
00084 }
00085
00086
00087 template <class Archive>
00088 void GG::UnicodeCharset::serialize(Archive& ar, const unsigned int version)
00089 {
00090 ar & BOOST_SERIALIZATION_NVP(m_script_name)
00091 & BOOST_SERIALIZATION_NVP(m_first_char)
00092 & BOOST_SERIALIZATION_NVP(m_last_char);
00093 }
00094
00095 #endif // _UnicodeCharsets_h_