source: trunk/poppler/mypoppler/poppler/Dict.h @ 461

Last change on this file since 461 was 257, checked in by Eugene Romanenko, 13 years ago

PDF plugin: Poppler library updated to version 0.10.0

File size: 2.6 KB
RevLine 
[2]1//========================================================================
2//
3// Dict.h
4//
5// Copyright 1996-2003 Glyph & Cog, LLC
6//
7//========================================================================
8
[257]9//========================================================================
10//
11// Modified under the Poppler project - http://poppler.freedesktop.org
12//
13// All changes made under the Poppler project to this file are licensed
14// under GPL version 2 or later
15//
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//
20// To see a description of the changes please see the Changelog file that
21// came with your tarball or type make ChangeLog if you are building from git
22//
23//========================================================================
24
[2]25#ifndef DICT_H
26#define DICT_H
27
28#ifdef USE_GCC_PRAGMAS
29#pragma interface
30#endif
31
32#include "Object.h"
33
34//------------------------------------------------------------------------
35// Dict
36//------------------------------------------------------------------------
37
38struct DictEntry {
[250]39  char *key;
[2]40  Object val;
41};
42
43class Dict {
44public:
45
46  // Constructor.
47  Dict(XRef *xrefA);
[250]48  Dict(Dict* dictA);
[2]49
50  // Destructor.
51  ~Dict();
52
53  // Reference counting.
54  int incRef() { return ++ref; }
55  int decRef() { return --ref; }
56
57  // Get number of entries.
58  int getLength() { return length; }
59
[250]60  // Add an entry.  NB: does not copy key.
61  void add(char *key, Object *val);
[2]62
[250]63  // Update the value of an existing entry, otherwise create it
64  void set(char *key, Object *val);
65  // Remove an entry. This invalidate indexes
66  void remove(char *key);
67
[2]68  // Check if dictionary is of specified type.
69  GBool is(char *type);
70
71  // Look up an entry and return the value.  Returns a null object
72  // if <key> is not in the dictionary.
[250]73  Object *lookup(char *key, Object *obj);
74  Object *lookupNF(char *key, Object *obj);
[2]75  GBool lookupInt(const char *key, const char *alt_key, int *value);
76
77  // Iterative accessors.
[250]78  char *getKey(int i);
[2]79  Object *getVal(int i, Object *obj);
80  Object *getValNF(int i, Object *obj);
81
82  // Set the xref pointer.  This is only used in one special case: the
83  // trailer dictionary, which is read before the xref table is
84  // parsed.
85  void setXRef(XRef *xrefA) { xref = xrefA; }
86
87private:
88
89  XRef *xref;                   // the xref table for this PDF file
90  DictEntry *entries;           // array of entries
91  int size;                     // size of <entries> array
92  int length;                   // number of entries in dictionary
93  int ref;                      // reference count
94
[250]95  DictEntry *find(char *key);
[2]96};
97
98#endif
Note: See TracBrowser for help on using the repository browser.