diff options
author | Nikias Bassen | 2019-11-07 04:54:45 +0100 |
---|---|---|
committer | Nikias Bassen | 2019-11-07 04:54:45 +0100 |
commit | 49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8 (patch) | |
tree | bc339ae6a11d149538d0a82af105bb73a86b6e17 /include | |
parent | 4d4586903b4cbab8b307a406e894e34b4b19a723 (diff) | |
download | libplist-49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8.tar.gz libplist-49cbc8df7672c4dd5fa0c73e9046ee91924ae4b8.tar.bz2 |
Add plist_get_data_ptr() and plist_get_string_ptr() to the interface
Diffstat (limited to 'include')
-rw-r--r-- | include/plist/plist.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index 824ba43..29b1fce 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -463,6 +463,19 @@ extern "C" void plist_get_string_val(plist_t node, char **val); /** + * Get a pointer to the buffer of a #PLIST_STRING node. + * + * @note DO NOT MODIFY the buffer. Mind that the buffer is only available + * until the plist node gets freed. Make a copy if needed. + * + * @param node The node + * @param length If non-NULL, will be set to the length of the string + * + * @return Pointer to the NULL-terminated buffer. + */ + const char* plist_get_string_ptr(plist_t node, uint64_t* length); + + /** * Get the value of a #PLIST_BOOLEAN node. * This function does nothing if node is not of type #PLIST_BOOLEAN * @@ -501,6 +514,19 @@ extern "C" void plist_get_data_val(plist_t node, char **val, uint64_t * length); /** + * Get a pointer to the data buffer of a #PLIST_DATA node. + * + * @note DO NOT MODIFY the buffer. Mind that the buffer is only available + * until the plist node gets freed. Make a copy if needed. + * + * @param node The node + * @param length Pointer to a uint64_t that will be set to the length of the buffer + * + * @return Pointer to the buffer + */ + const char* plist_get_data_ptr(plist_t node, uint64_t* length); + + /** * Get the value of a #PLIST_DATE node. * This function does nothing if node is not of type #PLIST_DATE * |