\end_document replaces \the_end.
[lyx.git] / src / chset.h
blob0ba6294d1f132086f865d65947b1dfb6dcb7a690
1 // -*- C++ -*-
2 /**
3 * \file chset.h
4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
6 */
8 #ifndef CHSET_H
9 #define CHSET_H
11 #include <map>
12 #include <utility>
14 #include "LString.h"
16 /// a class for mapping char strings such as "\^{A}" to the integer value
17 class CharacterSet {
18 public:
19 /**
20 * initialise this charset from the given .cdef file
21 * param charset the charset to look for
23 * Finds a .cdef file corresponding to the named charset
24 * and parses it. This function is only intended to be
25 * called once.
27 bool loadFile(string const & charset);
28 /// return the name of the current charset
29 string const & getName() const;
30 /**
31 * Return the encoded charset value of the given string.
33 * The bool value is false if an encoding could not be found
34 * in this charset, and true otherwise.
36 std::pair<bool, int> const encodeString(string const &) const;
37 private:
38 /// charset name
39 string name_;
40 ///
41 typedef std::map<string, unsigned char> Cdef;
42 /// mapping from string representation to encoded value
43 Cdef map_;
45 #endif