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) {
47 elems = (Object *)grealloc(elems, size * sizeof(Object));
49 elems[length] = *elem;
53 Object *Array::get(int i, Object *obj) {
54 if (i < 0 || i >= length) {
58 return obj->initNull();
61 return elems[i].fetch(xref, obj);
64 Object *Array::getNF(int i, Object *obj) {
65 if (i < 0 || i >= length) {
69 return obj->initNull();
72 return elems[i].copy(obj);