~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to src/Resource/encoding.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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
******************************************************************************/
 
12
 
 
13
#ifndef ENCODING_H
 
14
#define ENCODING_H
 
15
#include "resource.hpp"
 
16
 
 
17
RESOURCE(encoding);
 
18
 
 
19
/******************************************************************************
 
20
* The encoding structure
 
21
******************************************************************************/
 
22
 
 
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);
 
30
};
 
31
 
 
32
inline encoding_rep::encoding_rep (string s): rep<encoding>(s) {}
 
33
 
 
34
extern encoding universal_enc;
 
35
extern encoding always_enc;
 
36
extern encoding almost_always_enc;
 
37
extern encoding math_enc;
 
38
 
 
39
encoding num_enc ();
 
40
encoding capital_enc ();
 
41
encoding alpha_enc ();
 
42
encoding alpha_num_enc ();
 
43
 
 
44
encoding join (encoding enc1, encoding enc2);
 
45
 
 
46
#endif // defined ENCODING_H