1 : //========================================================================
2 : //
3 : // Array.h
4 : //
5 : // Copyright 1996-2003 Glyph & Cog, LLC
6 : //
7 : //========================================================================
8 :
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) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
18 : // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
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 :
25 : #ifndef ARRAY_H
26 : #define ARRAY_H
27 :
28 : #ifdef USE_GCC_PRAGMAS
29 : #pragma interface
30 : #endif
31 :
32 : #include "poppler-config.h"
33 : #include "Object.h"
34 : #include "goo/GooMutex.h"
35 :
36 : class XRef;
37 :
38 : //------------------------------------------------------------------------
39 : // Array
40 : //------------------------------------------------------------------------
41 :
42 : class Array {
43 : public:
44 :
45 : // Constructor.
46 : Array(XRef *xrefA);
47 :
48 : // Destructor.
49 : ~Array();
50 :
51 : // Reference counting.
52 : int incRef();
53 : int decRef();
54 :
55 : // Get number of elements.
56 11100 : int getLength() { return length; }
57 :
58 : // Copy array with new xref
59 : Object *copy(XRef *xrefA, Object *obj);
60 :
61 : // Add an element.
62 : void add(Object *elem);
63 :
64 : // Remove an element by position
65 : void remove(int i);
66 :
67 : // Accessors.
68 : Object *get(int i, Object *obj, int resursion = 0);
69 : Object *getNF(int i, Object *obj);
70 : GBool getString(int i, GooString *string);
71 :
72 : private:
73 :
74 : XRef *xref; // the xref table for this PDF file
75 : Object *elems; // array of elements
76 : int size; // size of <elems> array
77 : int length; // number of elements in array
78 : int ref; // reference count
79 : #if MULTITHREADED
80 : GooMutex mutex;
81 : #endif
82 : };
83 :
84 : #endif
|