CosObj
CosArrayGet(
CosObj
array
,
ASTArraySize
index
);
array | The array from which an element is obtained.
|
index | The array element to obtain. The first element in an array has an index of zero.
|
index
element of array
. It returns a NULL
Cos object if index
is outside the array bounds.
Inserts an object into an array.
An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document.
void
CosArrayInsert(
CosObj
array
,
ASTArraySize
pos
,
CosObj
obj
);
array | The array into which the object is inserted.
|
pos | The location in the array to insert the object. The object is inserted before the specified location. The first element in an array has a pos of zero. If It is not safe to call |
obj | The object to insert.
|
CosDictIsWeakReference
()
for details. ASBool
CosArrayIsWeakReference(
CosObj
array
,
ASInt32
n
);
array | An array.
|
n | The index of an item in the array.
|
isWeak
parameter in the most recent call to CosArraySetWeakReference
()
with these parameters, or false
if there has been no such call. array
. ASTArraySize
CosArrayLength(
CosObj
array
);
array | IN/OUT The array for which the number of elements is determined.
|
array
.
Puts the specified object into the specified location in an array. The array is extended as much as necessary and NULL
objects are stored in empty slots. It sets the PDDocNeedsSave
flag (see PDDocSetFlags
) flag of the array
object's CosDoc if array
is indirect or is a direct object with an indirect composite object at the root of its container chain.
It is not safe to call CosArrayPut
()
during a call to CosObjEnum
()
on that same array (for example, from within the callback procedure), if doing so would extend the length of the array.
An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document.
void
CosArrayPut(
CosObj
array
,
ASTArraySize
index
,
CosObj
obj
);
array | The array in which
obj is stored. |
index | The location in
array to store obj . The first element of an array has an index of zero. |
obj | The Cos object to insert into
array . |
Finds the first element, if any, equal to the specified object and removes it from the array. CosObjEqual
()
is used to determine whether an array element is equal to the specified object.
The array is compressed after removing the element. The compression is accomplished by moving each element following the deleted element to the slot with the next smaller index and decrementing the array's length by 1
.
It is not safe to call CosArrayRemove
()
during a call to CosObjEnum
()
on that same dictionary (for example, from within the callback procedure).
void
CosArrayRemove(
CosObj
array
,
CosObj
obj
);
array | The array from which
obj is removed. |
obj | The object to remove.
|
1
. It sets the dirty
flag of the array
object's CosDoc
. void
CosArrayRemoveNth(
CosObj
array
,
ASTArraySize
pos
);
array | IN/OUT The
CosArray from which to remove the member. |
pos | IN/OUT The index for the array member to remove. Array indices start at
0 . |
CosDictSetWeakReference
()
. void
CosArraySetWeakReference(
CosObj
array
,
ASInt32
n
,
ASBool
isWeak
);
array | An array.
|
n | The index of the element that is the weak reference. Note that the weak reference travels with the element; that is, if an item is marked as a weak reference, and an item is subsequently inserted before that item, the weak reference applies to the same element as it did previously.
|
isWeak | Sets a weak reference for an array.
|
CosObj
CosNewArray(
CosDoc
dP
,
ASBool
indirect
,
ASTArraySize
nElements
);
dP | The document in which the array is used.
|
indirect | If
true , it creates the array as an indirect Cos object, and sets the document's PDDocNeedsSave flag (see PDDocSetFlags ). If false , it creates the array as a direct object. |
nElements | The number of elements that will be in the array.
nElements is only a hint; Cos arrays grow dynamically as needed. |