An array construct.
More...
|
#define | PDArrayGetString(a, i) PDArrayGetTypedElement(a,i,PDInstanceTypeString) |
|
#define | PDArrayGetArray(a, i) PDArrayGetTypedElement(a,i,PDInstanceTypeArray) |
|
#define | PDArrayGetDictionary(a, i) PDArrayGetTypedElement(a,i,PDInstanceTypeDict) |
|
#define | PDArrayGetReference(a, i) PDArrayGetTypedElement(a,i,PDInstanceTypeRef) |
|
#define | PDArrayGetObject(a, i) PDArrayGetTypedElement(a,i,PDInstanceTypeObj) |
|
#define | PDArrayGetInteger(a, i) PDNumberGetInteger(PDArrayGetElement(a,i)) |
|
#define | encryptable(str) (strlen(str) > 0 && str[0] == '(' && str[strlen(str)-1] == ')') |
|
|
PDArrayRef | PDArrayCreateWithCapacity (PDInteger capacity) |
|
PDArrayRef | PDArrayCreateWithStackList (pd_stack stack) |
|
PDArrayRef | PDArrayCreateWithComplex (pd_stack stack) |
|
void | PDArrayClear (PDArrayRef array) |
|
PDInteger | PDArrayGetCount (PDArrayRef array) |
|
void * | PDArrayGetElement (PDArrayRef array, PDInteger index) |
|
void * | PDArrayGetTypedElement (PDArrayRef array, PDInteger index, PDInstanceType type) |
|
void | PDArrayAppend (PDArrayRef array, void *value) |
|
void | PDArrayInsertAtIndex (PDArrayRef array, PDInteger index, void *value) |
|
PDInteger | PDArrayGetIndex (PDArrayRef array, void *value) |
|
void | PDArrayDeleteAtIndex (PDArrayRef array, PDInteger index) |
|
void | PDArrayReplaceAtIndex (PDArrayRef array, PDInteger index, void *value) |
|
char * | PDArrayToString (PDArrayRef array) |
|
PDInteger | PDArrayPrinter (void *inst, char **buf, PDInteger offs, PDInteger *cap) |
|
void | PDArrayPrint (PDArrayRef array) |
|
void | PDArrayAttachCrypto (PDArrayRef array, pd_crypto crypto, PDInteger objectID, PDInteger genNumber) |
|
An array construct.
PDArrays maintain a list of objects, such as PDStrings, PDReferences, PDObjects, etc. and are able to produce a string representation compatible with the PDF specification for their corresponding content.
A low-performance array implementation.
The array construct.
void PDArrayAppend |
( |
PDArrayRef |
array, |
|
|
void * |
value |
|
) |
| |
Append value to the end of the array.
- Parameters
-
array | The array |
value | The value |
Supply a crypto object to an array, and associate the array with a specific object.
- Parameters
-
array | The array |
crypto | The pd_crypt object |
objectID | The object ID of the owning object |
genNumber | Generation number of the owning object |
Create a copy of the given array.
- Parameters
-
- Returns
- A new array, identical to array Clear the given array, removing all entries.
- Parameters
-
Create a new, empty array with the given capacity.
- Parameters
-
capacity | The number of slots to allocate for added elements |
- Returns
- Empty array
Converts a PDF array stack into an array.
- Parameters
-
- Returns
- New PDArray based on the stack representation of a PDF array
Converts a list of entries in the form of a stack into an array.
- Note
- This simply takes each element as is. To convert a PDF array stack representation into a PDArray, use PDArrayCreateWithComplex().
- Parameters
-
- Returns
- New PDArray based on the stack
Delete the element at the given index.
- Parameters
-
array | The array |
index | The index of the element to delete |
Get the number of elements in the array
- Parameters
-
- Returns
- Number of elements
Return the element at the given index.
- Parameters
-
array | The array |
index | The index of the element to retrieve |
- Returns
- An appropriate object.
Get the index of the given value in the array, or -1 if the value was not found.
- Parameters
-
array | The array |
value | The value to search for |
- Returns
- Index, or -1 if not found
Return the element at the given index, provided that it's of the given type. Otherwise return NULL.
- Parameters
-
array | The array |
index | The index of the element to retrieve |
type | The required type |
- Returns
- Instance of given instance type, or NULL if the instance type does not match the encountered value
Insert value at the given index in the array.
- Parameters
-
array | The array |
index | The index at which to insert the value |
value | The value |
Replace the element at the given index with value.
- Parameters
-
array | The array |
index | The index whose value should be overwritten |
value | The new value |
Generate a C string formatted according to the PDF specification for this array.
- Note
- The returned string must be freed.
- Parameters
-
- Returns
- C string representation of array