diff options
Diffstat (limited to 'include/plist')
| -rw-r--r-- | include/plist/plist.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index c289158..a075fc6 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h | |||
| @@ -109,6 +109,15 @@ extern "C" { | |||
| 109 | */ | 109 | */ |
| 110 | PLIST_API void plist_free(plist_t plist); | 110 | PLIST_API void plist_free(plist_t plist); |
| 111 | 111 | ||
| 112 | /** | ||
| 113 | * Return a copy of passed node and it's children | ||
| 114 | * | ||
| 115 | * @param plist the plist to copy | ||
| 116 | * @return copied plist | ||
| 117 | */ | ||
| 118 | PLIST_API plist_t plist_copy(plist_t node); | ||
| 119 | |||
| 120 | |||
| 112 | /******************************************** | 121 | /******************************************** |
| 113 | * * | 122 | * * |
| 114 | * Tree navigation * | 123 | * Tree navigation * |
| @@ -321,6 +330,77 @@ extern "C" { | |||
| 321 | PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec); | 330 | PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec); |
| 322 | 331 | ||
| 323 | 332 | ||
| 333 | /******************************************** | ||
| 334 | * * | ||
| 335 | * Setters * | ||
| 336 | * * | ||
| 337 | ********************************************/ | ||
| 338 | |||
| 339 | /** | ||
| 340 | * Set the value of a node. | ||
| 341 | * Forces type of node to #PLIST_KEY | ||
| 342 | * | ||
| 343 | * @param node the node | ||
| 344 | * @param val the key value | ||
| 345 | */ | ||
| 346 | PLIST_API void plist_set_key_val(plist_t node, const char *val); | ||
| 347 | |||
| 348 | /** | ||
| 349 | * Set the value of a node. | ||
| 350 | * Forces type of node to #PLIST_STRING | ||
| 351 | * | ||
| 352 | * @param node the node | ||
| 353 | * @param val the string value | ||
| 354 | */ | ||
| 355 | PLIST_API void plist_set_string_val(plist_t node, const char *val); | ||
| 356 | |||
| 357 | /** | ||
| 358 | * Set the value of a node. | ||
| 359 | * Forces type of node to #PLIST_BOOLEAN | ||
| 360 | * | ||
| 361 | * @param node the node | ||
| 362 | * @param val the boolean value | ||
| 363 | */ | ||
| 364 | PLIST_API void plist_set_bool_val(plist_t node, uint8_t val); | ||
| 365 | |||
| 366 | /** | ||
| 367 | * Set the value of a node. | ||
| 368 | * Forces type of node to #PLIST_UINT | ||
| 369 | * | ||
| 370 | * @param node the node | ||
| 371 | * @param val the unsigned integer value | ||
| 372 | */ | ||
| 373 | PLIST_API void plist_set_uint_val(plist_t node, uint64_t val); | ||
| 374 | |||
| 375 | /** | ||
| 376 | * Set the value of a node. | ||
| 377 | * Forces type of node to #PLIST_REAL | ||
| 378 | * | ||
| 379 | * @param node the node | ||
| 380 | * @param val the real value | ||
| 381 | */ | ||
| 382 | PLIST_API void plist_set_real_val(plist_t node, double val); | ||
| 383 | |||
| 384 | /** | ||
| 385 | * Set the value of a node. | ||
| 386 | * Forces type of node to #PLIST_DATA | ||
| 387 | * | ||
| 388 | * @param node the node | ||
| 389 | * @param val the binary buffer | ||
| 390 | * @param length the length of the buffer | ||
| 391 | */ | ||
| 392 | PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64_t length); | ||
| 393 | |||
| 394 | /** | ||
| 395 | * Set the value of a node. | ||
| 396 | * Forces type of node to #PLIST_DATE | ||
| 397 | * | ||
| 398 | * @param node the node | ||
| 399 | * @param sec the number of seconds since 01/01/2001 | ||
| 400 | * @param usec the number of microseconds | ||
| 401 | */ | ||
| 402 | PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t usec); | ||
| 403 | |||
| 324 | 404 | ||
| 325 | /******************************************** | 405 | /******************************************** |
| 326 | * * | 406 | * * |
