1 //========================================================================
5 // Copyright 1996-2003 Glyph & Cog, LLC
7 //========================================================================
9 //========================================================================
11 // Modified under the Poppler project - http://poppler.freedesktop.org
13 // All changes made under the Poppler project to this file are licensed
14 // under GPL version 2 or later
16 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
17 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
18 // Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
19 // Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
20 // Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha@gmail.com>
21 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
23 // To see a description of the changes please see the Changelog file that
24 // came with your tarball or type make ChangeLog if you are building from git
26 //========================================================================
31 #ifdef USE_GCC_PRAGMAS
35 #include "poppler-config.h"
37 #include "goo/GooMutex.h"
39 //------------------------------------------------------------------------
41 //------------------------------------------------------------------------
54 Dict
*copy(XRef
*xrefA
);
59 // Reference counting.
63 // Get number of entries.
64 int getLength() { return length
; }
66 // Add an entry. NB: does not copy key.
67 void add(char *key
, Object
*val
);
69 // Update the value of an existing entry, otherwise create it
70 void set(const char *key
, Object
*val
);
71 // Remove an entry. This invalidate indexes
72 void remove(const char *key
);
74 // Check if dictionary is of specified type.
75 GBool
is(const char *type
);
77 // Look up an entry and return the value. Returns a null object
78 // if <key> is not in the dictionary.
79 Object
*lookup(const char *key
, Object
*obj
, int recursion
= 0);
80 Object
*lookupNF(const char *key
, Object
*obj
);
81 GBool
lookupInt(const char *key
, const char *alt_key
, int *value
);
83 // Iterative accessors.
85 Object
*getVal(int i
, Object
*obj
);
86 Object
*getValNF(int i
, Object
*obj
);
88 // Set the xref pointer. This is only used in one special case: the
89 // trailer dictionary, which is read before the xref table is
91 void setXRef(XRef
*xrefA
) { xref
= xrefA
; }
93 XRef
*getXRef() { return xref
; }
95 GBool
hasKey(const char *key
);
100 XRef
*xref
; // the xref table for this PDF file
101 DictEntry
*entries
; // array of entries
102 int size
; // size of <entries> array
103 int length
; // number of entries in dictionary
104 int ref
; // reference count
109 DictEntry
*find(const char *key
);