2
/******************************************************************************
3
* MODULE : encoding.hpp
4
* DESCRIPTION: font encodings
5
* COPYRIGHT : (C) 1999 Joris van der Hoeven
6
*******************************************************************************
7
* This software falls under the GNU general public license and comes WITHOUT
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11
******************************************************************************/
15
#include "resource.hpp"
19
/******************************************************************************
20
* The encoding structure
21
******************************************************************************/
23
struct encoding_rep: rep<encoding> {
24
inline encoding_rep (string name);
25
virtual string encode (string s) = 0; // conversion from universal encoding
26
virtual string decode (string s) = 0; // conversion to universal encoding
27
virtual bool token_forward (string s, int& pos) = 0;
28
virtual bool token_backward (string s, int& pos) = 0;
29
virtual bool valid (string s);
32
inline encoding_rep::encoding_rep (string s): rep<encoding>(s) {}
34
extern encoding universal_enc;
35
extern encoding always_enc;
36
extern encoding almost_always_enc;
37
extern encoding math_enc;
40
encoding capital_enc ();
41
encoding alpha_enc ();
42
encoding alpha_num_enc ();
44
encoding join (encoding enc1, encoding enc2);
46
#endif // defined ENCODING_H