UnicodeCharsets.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /* GG is a GUI for SDL and OpenGL.
00003    Copyright (C) 2003-2008 T. Zachary Laine
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public License
00007    as published by the Free Software Foundation; either version 2.1
00008    of the License, or (at your option) any later version.
00009    
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014     
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA
00019 
00020    If you do not wish to comply with the terms of the LGPL please
00021    contact the author as other terms are available for a fee.
00022     
00023    Zach Laine
00024    whatwasthataddress@gmail.com */
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 } // namespace GG
00085 
00086 // template implementations
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_

Generated on Sat Mar 26 07:08:37 2011 for GG by  doxygen 1.5.9