a118f6852b01c9cb048fdbcc1dd06e32e2b94ec5
[swftools.git] / pdf2swf / xpdf / Array.h
1 //========================================================================
2 //
3 // Array.h
4 //
5 // Copyright 1996-2002 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef ARRAY_H
10 #define ARRAY_H
11
12 #ifdef __GNUC__
13 #pragma interface
14 #endif
15
16 #include "Object.h"
17
18 class XRef;
19
20 //------------------------------------------------------------------------
21 // Array
22 //------------------------------------------------------------------------
23
24 class Array {
25 public:
26
27   // Constructor.
28   Array(XRef *xrefA);
29
30   // Destructor.
31   ~Array();
32
33   // Reference counting.
34   int incRef() { return ++ref; }
35   int decRef() { return --ref; }
36
37   // Get number of elements.
38   int getLength() { return length; }
39
40   // Add an element.
41   void add(Object *elem);
42
43   // Accessors.
44   Object *get(int i, Object *obj);
45   Object *getNF(int i, Object *obj);
46
47 private:
48
49   XRef *xref;                   // the xref table for this PDF file
50   Object *elems;                // array of elements
51   int size;                     // size of <elems> array
52   int length;                   // number of elements in array
53   int ref;                      // reference count
54 };
55
56 #endif