filters
CMap.h00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef CMAP_H
00010 #define CMAP_H
00011
00012 #include <aconf.h>
00013
00014 #ifdef USE_GCC_PRAGMAS
00015 #pragma interface
00016 #endif
00017
00018 #include "gtypes.h"
00019 #include "CharTypes.h"
00020
00021 class GString;
00022 struct CMapVectorEntry;
00023 class CMapCache;
00024
00025
00026
00027 class CMap {
00028 public:
00029
00030
00031
00032 static CMap *parse(CMapCache *cache, GString *collectionA,
00033 GString *cMapNameA);
00034
00035 ~CMap();
00036
00037 void incRefCnt();
00038 void decRefCnt();
00039
00040
00041 GString *getCollection() { return collection; }
00042
00043
00044
00045 GBool match(GString *collectionA, GString *cMapNameA);
00046
00047
00048
00049
00050 CID getCID(char *s, int len, int *nUsed);
00051
00052
00053 int getWMode() { return wMode; }
00054
00055 private:
00056
00057 CMap(GString *collectionA, GString *cMapNameA);
00058 CMap(GString *collectionA, GString *cMapNameA, int wModeA);
00059 void useCMap(CMapCache *cache, char *useName);
00060 void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
00061 void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
00062 Guint nBytes);
00063 void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID);
00064 void freeCMapVector(CMapVectorEntry *vec);
00065
00066 GString *collection;
00067 GString *cMapName;
00068 int wMode;
00069 CMapVectorEntry *vector;
00070
00071 int refCnt;
00072 };
00073
00074
00075
00076 #define cMapCacheSize 4
00077
00078 class CMapCache {
00079 public:
00080
00081 CMapCache();
00082 ~CMapCache();
00083
00084
00085
00086
00087
00088 CMap *getCMap(GString *collection, GString *cMapName);
00089
00090 private:
00091
00092 CMap *cache[cMapCacheSize];
00093 };
00094
00095 #endif
|