From 21e389bca01794aeca1e79c92a86fc060549b835 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Wed, 15 Apr 2009 22:35:56 +0200 Subject: Add special accessor for structured types in API. --- include/plist/plist.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/plist/plist.h') diff --git a/include/plist/plist.h b/include/plist/plist.h index 7bdd00a..b7b0fa4 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -140,6 +140,25 @@ extern "C" { */ PLIST_API plist_t plist_get_prev_sibling(plist_t node); +/** + * Get the nth child of a #PLIST_ARRAY node. + * + * @param node the node of type #PLIST_ARRAY + * @param n the index of the child to get. Range is [0, array_size[ + * @return the nth children or NULL if node is not of type #PLIST_ARRAY + */ + PLIST_API plist_t plist_get_array_nth_el(plist_t node, uint32_t n); + +/** + * Get the child of a #PLIST_DICT node from the associated key value. + * + * @param node the node of type #PLIST_DICT + * @param key the key associated to the requested value + * @return the key associated value or NULL if node is not of type #PLIST_DICT + */ + PLIST_API plist_t plist_get_dict_el_from_key(plist_t node, const char *key); + + /******************************************** * * * Setters * -- cgit v1.1-32-gdbae