2002-08-30 09:14:01 +00:00
|
|
|
//========================================================================
|
|
|
|
//
|
|
|
|
// Array.h
|
|
|
|
//
|
2003-08-20 21:25:12 +00:00
|
|
|
// Copyright 1996-2003 Glyph & Cog, LLC
|
2002-08-30 09:14:01 +00:00
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
#ifndef ARRAY_H
|
|
|
|
#define ARRAY_H
|
|
|
|
|
2002-12-25 00:53:02 +00:00
|
|
|
#include <aconf.h>
|
|
|
|
|
|
|
|
#ifdef USE_GCC_PRAGMAS
|
2002-08-30 09:14:01 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Object.h"
|
|
|
|
|
|
|
|
class XRef;
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Array
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Array {
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor.
|
|
|
|
Array(XRef *xrefA);
|
|
|
|
|
|
|
|
// Destructor.
|
|
|
|
~Array();
|
|
|
|
|
|
|
|
// Reference counting.
|
|
|
|
int incRef() { return ++ref; }
|
|
|
|
int decRef() { return --ref; }
|
|
|
|
|
|
|
|
// Get number of elements.
|
|
|
|
int getLength() { return length; }
|
|
|
|
|
|
|
|
// Add an element.
|
|
|
|
void add(Object *elem);
|
|
|
|
|
|
|
|
// Accessors.
|
|
|
|
Object *get(int i, Object *obj);
|
|
|
|
Object *getNF(int i, Object *obj);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
XRef *xref; // the xref table for this PDF file
|
|
|
|
Object *elems; // array of elements
|
|
|
|
int size; // size of <elems> array
|
|
|
|
int length; // number of elements in array
|
|
|
|
int ref; // reference count
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|