LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
dictionary.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/model/defs.h>

Go to the source code of this file.

Functions

LO_RESULT LODictionaryCreate (LODictionaryRef *dictionary)
 Creates an new empty dictionary object. More...
 
LO_RESULT LODictionaryRelease (LODictionaryRef *dictionary)
 Releases a dictionary object. *dictionary will be set to invalid by this function. More...
 
LO_RESULT LODictionaryGetValue (LODictionaryRef dictionary, const char *key, LOTypedValueRef value)
 Retrieves the value associated with a given key from a dictionary. More...
 
LO_RESULT LODictionarySetValue (LODictionaryRef dictionary, const char *key, LOTypedValueRef value)
 Inserts a key-value pair into a dictionary object. More...
 
LO_RESULT LODictionaryClear (LODictionaryRef dictionary)
 Removes all of the key-value pairs from a dictionary. More...
 
LO_RESULT LODictionaryGetNumberOfKeys (LODictionaryRef dictionary, size_t *out_number_of_keys)
 Gets the number of entries in the dictionary. More...
 
LO_RESULT LODictionaryGetKeys (LODictionaryRef dictionary, size_t key_array_length, SUStringRef keys[], size_t *out_number_of_keys_copied)
 Gets all the keys in the dictionary. More...
 
LO_RESULT LODictionaryRemoveEntry (LODictionaryRef dictionary, const char *key)
 Remove the entry in the dictionary for the given key. More...
 

Function Documentation

LO_RESULT LODictionaryClear ( LODictionaryRef  dictionary)

Removes all of the key-value pairs from a dictionary.

Since
LayOut 2018, API 3.0
Parameters
[in]dictionaryThe dictionary object.
Returns
LO_RESULT LODictionaryCreate ( LODictionaryRef dictionary)

Creates an new empty dictionary object.

Parameters
[out]dictionaryThe newly created dictionary object.
Returns
LO_RESULT LODictionaryGetKeys ( LODictionaryRef  dictionary,
size_t  key_array_length,
SUStringRef  keys[],
size_t *  out_number_of_keys_copied 
)

Gets all the keys in the dictionary.

Since
LayOut 2018, API 3.0
Returns
LO_RESULT LODictionaryGetNumberOfKeys ( LODictionaryRef  dictionary,
size_t *  out_number_of_keys 
)

Gets the number of entries in the dictionary.

Since
LayOut 2018, API 3.0
Returns
LO_RESULT LODictionaryGetValue ( LODictionaryRef  dictionary,
const char *  key,
LOTypedValueRef  value 
)

Retrieves the value associated with a given key from a dictionary.

Parameters
[in]dictionaryThe dictionary object.
[in]keyThe key of the key-value pair. Assumed to be UTF-8 encoded.
[out]valueThe value retrieved. Must be a valid object, i.e. must have been created via LOTypedValueCreate.
Returns
LO_RESULT LODictionaryRelease ( LODictionaryRef dictionary)

Releases a dictionary object. *dictionary will be set to invalid by this function.

Parameters
[in]dictionaryThe dictionary object.
Returns
LO_RESULT LODictionaryRemoveEntry ( LODictionaryRef  dictionary,
const char *  key 
)

Remove the entry in the dictionary for the given key.

Since
LayOut 2018, API 3.0
Returns
LO_RESULT LODictionarySetValue ( LODictionaryRef  dictionary,
const char *  key,
LOTypedValueRef  value 
)

Inserts a key-value pair into a dictionary object.

Parameters
[in]dictionaryThe dictionary object.
[in]keyThe key of the key-value pair. Assumed to be UTF-8 encoded.
[in]valueThe value of the key-value pair.
Returns