diff options
Diffstat (limited to 'filters/kword/pdf/xpdf/xpdf/Dict.cc')
-rw-r--r-- | filters/kword/pdf/xpdf/xpdf/Dict.cc | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/filters/kword/pdf/xpdf/xpdf/Dict.cc b/filters/kword/pdf/xpdf/xpdf/Dict.cc deleted file mode 100644 index 351c23a02..000000000 --- a/filters/kword/pdf/xpdf/xpdf/Dict.cc +++ /dev/null @@ -1,91 +0,0 @@ -//======================================================================== -// -// Dict.cc -// -// Copyright 1996-2002 Glyph & Cog, LLC -// -//======================================================================== - -#include <aconf.h> - -#ifdef USE_GCC_PRAGMAS -#pragma implementation -#endif - -#include <stddef.h> -#include <string.h> -#include "gmem.h" -#include "Object.h" -#include "XRef.h" -#include "Dict.h" - -//------------------------------------------------------------------------ -// Dict -//------------------------------------------------------------------------ - -Dict::Dict(XRef *xrefA) { - xref = xrefA; - entries = NULL; - size = length = 0; - ref = 1; -} - -Dict::~Dict() { - int i; - - for (i = 0; i < length; ++i) { - gfree(entries[i].key); - entries[i].val.free(); - } - gfree(entries); -} - -void Dict::add(char *key, Object *val) { - if (length + 1 > size) { - size += 8; - entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry)); - } - entries[length].key = key; - entries[length].val = *val; - ++length; -} - -inline DictEntry *Dict::find(const char *key) { - int i; - - for (i = 0; i < length; ++i) { - if (!strcmp(key, entries[i].key)) - return &entries[i]; - } - return NULL; -} - -GBool Dict::is(const char *type) { - DictEntry *e; - - return (e = find("Type")) && e->val.isName(type); -} - -Object *Dict::lookup(const char *key, Object *obj) { - DictEntry *e; - - return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull(); -} - -Object *Dict::lookupNF(const char *key, Object *obj) { - DictEntry *e; - - return (e = find(key)) ? e->val.copy(obj) : obj->initNull(); -} - -char *Dict::getKey(int i) { - return entries[i].key; -} - -Object *Dict::getVal(int i, Object *obj) { - return entries[i].val.fetch(xref, obj); -} - -Object *Dict::getValNF(int i, Object *obj) { - return entries[i].val.copy(obj); -} |