4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
19 #include "support/types.h"
23 namespace support { class FileName; }
31 Encoding(std::string const & n, std::string const & l,
32 std::string const & i)
33 : Name_(n), LatexName_(l), iconvName_(i)
37 std::string const & name() const { return Name_; }
39 std::string const & latexName() const { return LatexName_; }
41 std::string const & iconvName() const { return iconvName_; }
46 std::string LatexName_;
48 std::string iconvName_;
54 typedef std::map<std::string, Encoding> EncodingList;
55 /// iterator to iterate over all encodings.
56 /// We hide the fact that our encoding list is implemented as a map.
57 class const_iterator : public EncodingList::const_iterator {
58 typedef EncodingList::const_iterator base;
60 const_iterator() : base() {}
61 const_iterator(base const & b) : base(b) {}
62 Encoding const & operator*() const { return base::operator*().second; }
63 Encoding const * operator->() const { return &(base::operator*().second); }
68 void read(support::FileName const & filename);
69 /// Get encoding from LyX name \p name
70 Encoding const * getFromLyXName(std::string const & name) const;
71 /// Get encoding from LaTeX name \p name
72 Encoding const * getFromLaTeXName(std::string const & name) const;
75 const_iterator begin() const { return encodinglist.begin(); }
77 const_iterator end() const { return encodinglist.end(); }
91 static bool isComposeChar_hebrew(char_type c);
93 static bool isComposeChar_arabic(char_type c);
95 static bool is_arabic_special(char_type c);
97 static bool is_arabic(char_type c);
99 static char_type transformChar(char_type c, Letter_Form form);
103 EncodingList encodinglist;
106 extern Encodings encodings;