1 //========================================================================
5 // Copyright 1996-2003 Glyph & Cog, LLC
7 //========================================================================
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
21 //------------------------------------------------------------------------
23 //------------------------------------------------------------------------
25 Array::Array(XRef *xrefA) {
35 for (i = 0; i < length; ++i)
40 void Array::add(Object *elem) {
41 if (length + 1 > size) {
43 elems = (Object *)grealloc(elems, size * sizeof(Object));
45 elems[length] = *elem;
49 Object *Array::get(int i, Object *obj) {
50 if (i < 0 || i >= length) {
54 return obj->initNull();
57 return elems[i].fetch(xref, obj);
60 Object *Array::getNF(int i, Object *obj) {
61 if (i < 0 || i >= length) {
65 return obj->initNull();
68 return elems[i].copy(obj);