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