File: TranslateCodingSystem.h

package info (click to toggle)
jade 1.2.1-43
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,808 kB
  • ctags: 16,989
  • sloc: cpp: 120,657; sh: 10,452; ansic: 8,228; perl: 378; makefile: 296; sed: 5
file content (52 lines) | stat: -rw-r--r-- 1,485 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 1997 James Clark
// See the file COPYING for copying permission.

#ifndef TranslateCodingSystem_INCLUDED
#define TranslateCodingSystem_INCLUDED 1

#include "CodingSystem.h"
#include "Ptr.h"
#include "CharMap.h"
#include "CharsetRegistry.h"
#include "types.h"

#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif

class SP_API TranslateCodingSystem : public CodingSystem {
public:
  struct Desc {
    CharsetRegistry::ISORegistrationNumber number;
    // How much to add to the values in the base set.
    Char add;
  };
  // codingSystem is the underlying BCTF
  // desc describes the meaning of the bit combinations produced by that BCTF
  // charset is the system character set
  // replacementChar is character in systemCharset that should be used to represent
  // characters that do not exist in the systemCharset.
  // illegalChar is a code that can never be produced by the underlying BCTF.
  TranslateCodingSystem(const CodingSystem *codingSystem,
			const Desc *desc,
			const CharsetInfo *charset,
			Char illegalChar,
			Char replacementChar);
  Decoder *makeDecoder() const;
  Encoder *makeEncoder() const;
  unsigned fixedBytesPerChar() const;
private:
  ConstPtr<CharMapResource<Char> > decodeMap_;
  ConstPtr<CharMapResource<Char> > encodeMap_;
  const CodingSystem *sub_;
  const Desc *desc_;
  const CharsetInfo *charset_;
  Char illegalChar_;
  Char replacementChar_;
};

#ifdef SP_NAMESPACE
}
#endif

#endif /* not TranslateCodingSystem_INCLUDED */