filters
Dict.h00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef DICT_H
00010 #define DICT_H
00011
00012 #include <aconf.h>
00013
00014 #ifdef USE_GCC_PRAGMAS
00015 #pragma interface
00016 #endif
00017
00018 #include "Object.h"
00019
00020
00021
00022
00023
00024 struct DictEntry {
00025 char *key;
00026 Object val;
00027 };
00028
00029 class Dict {
00030 public:
00031
00032
00033 Dict(XRef *xrefA);
00034
00035
00036 ~Dict();
00037
00038
00039 int incRef() { return ++ref; }
00040 int decRef() { return --ref; }
00041
00042
00043 int getLength() { return length; }
00044
00045
00046 void add(char *key, Object *val);
00047
00048
00049 GBool is(const char *type);
00050
00051
00052
00053 Object *lookup(const char *key, Object *obj);
00054 Object *lookupNF(const char *key, Object *obj);
00055
00056
00057 char *getKey(int i);
00058 Object *getVal(int i, Object *obj);
00059 Object *getValNF(int i, Object *obj);
00060
00061
00062
00063
00064 void setXRef(XRef *xrefA) { xref = xrefA; }
00065
00066 private:
00067
00068 XRef *xref;
00069 DictEntry *entries;
00070 int size;
00071 int length;
00072 int ref;
00073
00074 DictEntry *find(const char *key);
00075 };
00076
00077 #endif
|