GG
UnicodeCharsets.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /* GG is a GUI for SDL and OpenGL.
3  Copyright (C) 2003-2008 T. Zachary Laine
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public License
7  as published by the Free Software Foundation; either version 2.1
8  of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18  02111-1307 USA
19 
20  If you do not wish to comply with the terms of the LGPL please
21  contact the author as other terms are available for a fee.
22 
23  Zach Laine
24  whatwasthataddress@gmail.com */
25 
30 #ifndef _UnicodeCharsets_h_
31 #define _UnicodeCharsets_h_
32 
33 #include <GG/Base.h>
34 
35 #include <boost/cstdint.hpp>
36 
37 #include <set>
38 
39 
40 namespace GG {
41 
48 struct GG_API UnicodeCharset
49 {
51  UnicodeCharset(std::string script_name, boost::uint32_t first_char, boost::uint32_t last_char);
52 
53  std::string m_script_name;
54  boost::uint32_t m_first_char;
55  boost::uint32_t m_last_char;
56 };
57 
59 GG_API bool operator==(const UnicodeCharset& lhs, const UnicodeCharset& rhs);
60 
62 GG_API bool operator<(const UnicodeCharset& lhs, const UnicodeCharset& rhs);
63 
64 
66 GG_API const std::vector<UnicodeCharset>& AllUnicodeCharsets();
67 
69 GG_API std::set<UnicodeCharset> UnicodeCharsetsToRender(const std::string& str);
70 
73 GG_API const UnicodeCharset* CharsetContaining(boost::uint32_t c);
74 
77 GG_API const UnicodeCharset* CharsetWithName(const std::string& name);
78 
79 } // namespace GG
80 
81 #endif