An opaque pointer to a collection schema object.
A PDCollectionSchema is ordered with the following considerations. The PDCollectionSchema has characteristics of both a collection of named fields and an array. Field names are guaranteed to be unique. Indexing is guaranteed to be 0-based, in ascending order, with no gaps. When repositioning a field by changing its index, the schema will be re-indexed as necessary to conform to this convention. If a field is assigned an out-of-bound index, the index is adjusted to be in bounds rather than raising an error.
typedef struct CPDCollectionSchema *PDCollectionSchema;
PDCollectionSchema object for a collection. PDCollectionSchema PDCollectionSchemaAcquire(PDCollection collection);
collection | The collection object.
|
PDCollectionSchema object. void PDCollectionSchemaDestroy(PDCollectionSchema schema);
collection | The collection object.
|
field.size to sizeof(PDCollectionFieldRec). To look up a field by name, set field.fieldName to the appropriate name. To look up a field by position, set field.fieldName to ASAtomNull, and set field.index to the position. The caller owns (and must destroy) field.fieldText if it is not NULL. ASBool PDCollectionSchemaGetField(PDCollectionSchema schema, PDCollectionFieldRec *field);
schema | The collection schema object.
|
field | The field to be obtained.
|
ASArraySize PDCollectionSchemaGetLength(PDCollectionSchema schema);
collection | The collection object.
|
void PDCollectionSchemaRemoveField(PDCollectionSchema schema, ASAtom fieldName);
schema | The collection schema.
|
fieldName | The name of the field to remove from the collection schema.
|
field.fieldName member. If the target field exists, it is overwritten; otherwise a new field is added. The caller must set field.size to sizeof(PDCollectionFieldRec). Specifying a new value for field.index will affect other field values as necessary to maintain the correct overall ordering. See PDCollectionSchema for information about ordering. void PDCollectionSchemaSetField(PDCollectionSchema schema, const PDCollectionFieldRec *field);
schema | The collection schema object.
|
field | The field to add or modify in the collection schema.
|