Typedefs | |
typedef struct plitem_s | plitem_t |
Generic property list item. More... | |
Enumerations | |
enum | pltype_t { QFDictionary, QFArray, QFBinary, QFString } |
The type of the property list item. More... | |
Functions | |
qboolean | PL_A_AddObject (plitem_t *array, plitem_t *item) |
Add an item to an array. More... | |
qboolean | PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int index) |
Insert an item into an array before the specified location. More... | |
int | PL_A_NumObjects (plitem_t *array) |
Retrieve the number of items in an array. More... | |
qboolean | PL_D_AddObject (plitem_t *dict, const char *key, plitem_t *value) |
Add a key/value pair to a dictionary. More... | |
plitem_t * | PL_D_AllKeys (plitem_t *dict) |
Retrieve a list of all keys in a dictionary. More... | |
int | PL_D_NumKeys (plitem_t *dict) |
Retrieve the number of keys in a dictionary. More... | |
void | PL_Free (plitem_t *item) |
Free a property list object. More... | |
plitem_t * | PL_GetPropertyList (const char *string) |
Create an in-memory representation of the contents of a property list. More... | |
plitem_t * | PL_NewArray (void) |
Create a new array object. More... | |
plitem_t * | PL_NewData (void *data, size_t size) |
Create a new data object from the given data. More... | |
plitem_t * | PL_NewDictionary (void) |
Create a new dictionary object. More... | |
plitem_t * | PL_NewString (const char *str) |
Create a new string object. More... | |
plitem_t * | PL_ObjectAtIndex (plitem_t *array, int index) |
Retrieve a value from an array object. More... | |
plitem_t * | PL_ObjectForKey (plitem_t *dict, const char *key) |
Retrieve a value from a dictionary object. More... | |
plitem_t * | PL_RemoveObjectAtIndex (plitem_t *array, int index) |
Remove a value from an array object. More... | |
plitem_t * | PL_RemoveObjectForKey (plitem_t *dict, const char *key) |
Remove a value from a dictionary object. More... | |
const char * | PL_String (plitem_t *string) |
Retrieve a string from a string object. More... | |
pltype_t | PL_Type (plitem_t *item) |
Retrieve the type of an object. More... | |
char * | PL_WritePropertyList (plitem_t *pl) |
Create a property list string from the in-memory representation. More... | |
typedef struct plitem_s plitem_t |
Generic property list item.
All inspection and manipulation is to be done via the accessor functions.
enum pltype_t |
The type of the property list item.
For further details, see Property List.
Add an item to an array.
array | The array to which the item will be added |
item | The item to be added to the array |
Insert an item into an array before the specified location.
array | The array to which the item will be added |
item | The item to be added to the array |
index | The location at which to insert the item into the array |
Retrieve the number of items in an array.
array | The array from which to get the number of objects |
Add a key/value pair to a dictionary.
dict | The dictionary to which the key/value pair will be added |
key | The key of the key/value pair to be added to the dictionary |
value | The value of the key/value pair to be added to the dictionary |
Retrieve a list of all keys in a dictionary.
dict | The dictionary to list |
Retrieve the number of keys in a dictionary.
dict | The dictionary to get the number of keys of. |
void PL_Free | ( | plitem_t * | item | ) |
Free a property list object.
This function takes care of freeing any referenced property list data, so call it only on top-level objects.
item | the property list object to be freed |
Create an in-memory representation of the contents of a property list.
string | the saved plist, as read from a file. |
plitem_t* PL_NewArray | ( | void | ) |
Create a new array object.
The array will be empty.
plitem_t* PL_NewData | ( | void * | data, |
size_t | size | ||
) |
Create a new data object from the given data.
Takes ownership of the given data.
data | pointer to data buffer |
size | number of bytes in the buffer |
plitem_t* PL_NewDictionary | ( | void | ) |
Create a new dictionary object.
The dictionary will be empty.
Create a new string object.
Makes a copy of the given string.
str | C string to copy |
Retrieve a value from an array object.
array | The array to get the value from |
index | The index within the array to retrieve |
Retrieve a value from a dictionary object.
dict | The dictionary to retrieve a value from |
key | The unique key associated with the value |
Remove a value from an array object.
The array items will be shuffled to fill the resulting hole.
array | The array from which to remove the value |
index | The index within the array to remove |
Remove a value from a dictionary object.
dict | The Dictionary to remove the value from |
key | The unique key associated with the value to be removed |
Retrieve a string from a string object.
string | The string object |
Retrieve the type of an object.
item | The object |
char* PL_WritePropertyList | ( | plitem_t * | pl | ) |
Create a property list string from the in-memory representation.
pl | the in-memory representation |