Layer | COS_Layer |
Object | CosArray |
Cos arrays are one-dimensional collections of objects accessed by a numeric index. Array indexes are zero-based. An array's elements may be any combination of the Cos data types.
Define | ||
---|---|---|
CosArrayIsWeakReference | ||
CosArraySetWeakReference |
Method | ||
---|---|---|
Gets the specified element from an array.
|
||
Inserts an object into an array.
|
||
Return the state of a weak reference in an array. See
CosDictIsWeakReference()
for details.
|
||
ASTArraySize CosArrayLength(CosObj array)
Gets the number of elements in 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.
|
||
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.
|
||
Checks whether the position is within the array bounds, removes it from the array, moves each subsequent element to the slot with the next smaller index, and decrements the array's length by 1. It sets the dirty flag of the array object's CosDoc.
|
||
Establishes or removes a weak reference from an array. For a description of weak references, see
CosDictSetWeakReference()
.
|
||
Creates and returns a new array Cos object.
|
CosArrayIsWeakReference |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosArrayIsWeakReference CosCallMacro(CosArrayIsWeakReference, 7)
File: CosCalls.h |
Line: 446 |
CosArraySetWeakReference |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosArraySetWeakReference CosCallMacro(CosArraySetWeakReference, 7)
File: CosCalls.h |
Line: 445 |
CosArrayGet | () |
Product availability: All |
Platform availability: All |
CosObj CosArrayGet(CosObj array, ASTArraySize index)
Gets the specified element from an array.
Parameters
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. |
The Cos object occupying the |
See Also
Since
File: CosProcs.h |
Line: 765 |
CosArrayInsert | () |
Product availability: All |
Platform availability: All |
void CosArrayInsert(CosObj array, ASTArraySize pos, CosObj obj)
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.
Parameters
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. |
See Also
Since
File: CosProcs.h |
Line: 819 |
CosArrayIsWeakReference | () |
Product availability: All |
Platform availability: All |
Return the state of a weak reference in an array. See
CosDictIsWeakReference()
for details.
Parameters
array — | An array. |
|
n — | The index of an item in the array. |
Returns the value of the |
Since
File: CosProcs.h |
Line: 2073 |
CosArrayLength | () |
Product availability: All |
Platform availability: All |
ASTArraySize CosArrayLength(CosObj array)
Gets the number of elements in array
.
Parameters
array — | IN/OUT The array for which the number of elements is determined. |
The number of elements in |
Since
File: CosProcs.h |
Line: 849 |
CosArrayPut | () |
Product availability: All |
Platform availability: All |
void CosArrayPut(CosObj array, ASTArraySize index, CosObj obj)
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.
Parameters
array — | The array in which |
|
index — | The location in |
|
obj — | The Cos object to insert into |
See Also
Since
File: CosProcs.h |
Line: 793 |
CosArrayRemove | () |
Product availability: All |
Platform availability: All |
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).
Parameters
array — | The array from which |
|
obj — | The object to remove. |
See Also
Since
File: CosProcs.h |
Line: 840 |
CosArrayRemoveNth | () |
Product availability: All |
Platform availability: All |
void CosArrayRemoveNth(CosObj array, ASTArraySize pos)
Checks whether the position is within the array bounds, removes it from the array, moves each subsequent element to the slot with the next smaller index, and decrements the array's length by 1
. It sets the dirty
flag of the array
object's CosDoc
.
Parameters
array — | IN/OUT The |
|
pos — | IN/OUT The index for the array member to remove. Array indices start at |
See Also
Since
File: CosProcs.h |
Line: 1314 |
CosArraySetWeakReference | () |
Product availability: All |
Platform availability: All |
Establishes or removes a weak reference from an array. For a description of weak references, see
CosDictSetWeakReference()
.
Parameters
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. |
Since
File: CosProcs.h |
Line: 2062 |
CosNewArray | () |
Product availability: All |
Platform availability: All |
CosObj CosNewArray(CosDoc dP, ASBool indirect, ASTArraySize nElements)
Creates and returns a new array Cos object.
Parameters
dP — | The document in which the array is used. |
|
indirect — | If |
|
nElements — | The number of elements that will be in the array. |
The newly created array Cos object. |
See Also
Since
File: CosProcs.h |
Line: 259 |