LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends 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] | dictionary | The dictionary object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dictionary is an invalid object

LO_RESULT LODictionaryCreate | ( | LODictionaryRef * | dictionary | ) |

Creates an new empty dictionary object.

Parameters

  [out] | dictionary | The newly created dictionary object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if dictionary is NULL
  - SU_ERROR_OVERWRITE_VALID if *dictionary already refers to a valid object

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
  - SU_ERROR_NONE on success.
  - SU_ERROR_INVALID_INPUT if dictionary refers to an invalid reference
  - SU_ERROR_OUT_OF_RANGE if key_array_length must be at least 1
  - SU_ERROR_NULL_POINTER_OUTPUT if out_key_array or out_number_of_keys_copied is NULL
  - SU_ERROR_INVALID_OUTPUT if keys contains one or more invalid objects

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
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dictionary does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if out_number_of_keys is NULL

LO_RESULT LODictionaryGetValue | ( | LODictionaryRef | dictionary,
|  | const char * | key,
|  | LOTypedValueRef | value
| ) |  |

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

Parameters

  [in] | dictionary | The dictionary object.
  [in] | key | The key of the key-value pair. Assumed to be UTF-8 encoded.
  [out] | value | The value retrieved. Must be a valid object, i.e. must have been created via LOTypedValueCreate.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dictionary is an invalid object
  - SU_ERROR_NULL_POINTER_INPUT if key is NULL
  - SU_ERROR_INVALID_OUTPUT if value is an invalid object
  - SU_ERROR_NO_DATA if there is no value associated with the given key in the dictionary

LO_RESULT LODictionaryRelease | ( | LODictionaryRef * | dictionary | ) |

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

Parameters

  [in] | dictionary | The dictionary object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if dictionary is NULL
  - SU_ERROR_INVALID_INPUT if *dictionary references an invalid object

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
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dictionary or key refer to invalid references
  - SU_ERROR_NO_DATA if there is no value to delete for the given key

LO_RESULT LODictionarySetValue | ( | LODictionaryRef | dictionary,
|  | const char * | key,
|  | LOTypedValueRef | value
| ) |  |

Inserts a key-value pair into a dictionary object.

Parameters

  [in] | dictionary | The dictionary object.
  [in] | key | The key of the key-value pair. Assumed to be UTF-8 encoded.
  [in] | value | The value of the key-value pair.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dictionary is an invalid object
  - SU_ERROR_NULL_POINTER_INPUT if key is NULL