filters
CharCodeToUnicode.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CHARCODETOUNICODE_H
00012 #define CHARCODETOUNICODE_H
00013
00014 #include <aconf.h>
00015
00016 #ifdef USE_GCC_PRAGMAS
00017 #pragma interface
00018 #endif
00019
00020 #include "CharTypes.h"
00021
00022 struct CharCodeToUnicodeString;
00023
00024
00025
00026 class CharCodeToUnicode {
00027 public:
00028
00029
00030
00031
00032 static CharCodeToUnicode *parseCIDToUnicode(GString *collectionA);
00033
00034
00035
00036
00037 static CharCodeToUnicode *make8BitToUnicode(Unicode *toUnicode);
00038
00039
00040 static CharCodeToUnicode *parseCMap(GString *buf, int nBits);
00041
00042 ~CharCodeToUnicode();
00043
00044 void incRefCnt();
00045 void decRefCnt();
00046
00047
00048 GBool match(GString *collectionA);
00049
00050
00051 int mapToUnicode(CharCode c, Unicode *u, int size);
00052
00053 private:
00054
00055 void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits);
00056 CharCodeToUnicode(GString *collectionA);
00057 CharCodeToUnicode(GString *collectionA, Unicode *mapA,
00058 CharCode mapLenA, GBool copyMap,
00059 CharCodeToUnicodeString *sMapA, int sMapLenA);
00060
00061 GString *collection;
00062 Unicode *map;
00063 CharCode mapLen;
00064 CharCodeToUnicodeString *sMap;
00065 int sMapLen, sMapSize;
00066 int refCnt;
00067 };
00068
00069
00070
00071 #define cidToUnicodeCacheSize 4
00072
00073 class CIDToUnicodeCache {
00074 public:
00075
00076 CIDToUnicodeCache();
00077 ~CIDToUnicodeCache();
00078
00079
00080
00081
00082
00083 CharCodeToUnicode *getCIDToUnicode(GString *collection);
00084
00085 private:
00086
00087 CharCodeToUnicode *cache[cidToUnicodeCacheSize];
00088 };
00089
00090 #endif
|