replace most &dquot;...&dquot; by <...>
[lyx.git] / src / chset.h
blob468ce2399540d2aee9d8b1f731370ff81dee9132
1 // -*- C++ -*-
2 /**
3 * \file chset.h
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.
13 #ifndef CHSET_H
14 #define CHSET_H
16 #include <map>
17 #include <utility>
18 #include <string>
21 /// a class for mapping char strings such as "\^{A}" to the integer value
22 class CharacterSet {
23 public:
24 /**
25 * initialise this charset from the given .cdef file
26 * param charset the charset to look for
28 * Finds a .cdef file corresponding to the named charset
29 * and parses it. This function is only intended to be
30 * called once.
32 bool loadFile(std::string const & charset);
33 /// return the name of the current charset
34 std::string const & getName() const;
35 /**
36 * Return the encoded charset value of the given string.
38 * The bool value is false if an encoding could not be found
39 * in this charset, and true otherwise.
41 std::pair<bool, int> const encodeString(std::string const &) const;
42 private:
43 /// charset name
44 std::string name_;
45 ///
46 typedef std::map<std::string, unsigned char> Cdef;
47 /// mapping from string representation to encoded value
48 Cdef map_;
50 #endif