libplist  2.7.0
API Documentation - Return to Homepage

◆ plist_dict_copy_string()

PLIST_API plist_err_t plist_dict_copy_string ( plist_t  target_dict,
plist_t  source_dict,
const char *  key,
const char *  alt_source_key 
)

Copy a PLIST_STRING node from source_dict to target_dict.

The node is looked up in source_dict with given key, unless alt_source_key is non-NULL, in which case it is looked up with alt_source_key. The entry in target_dict is always created with key.

Note
This function is like plist_dict_copy_item, except that it fails if the source node is not of type PLIST_STRING.
Parameters
target_dictThe target dictionary to copy to.
source_dictThe source dictionary to copy from.
keyThe key for the node value to copy.
alt_source_keyThe alternative source key for lookup in source_dict or NULL.
Returns
PLIST_ERR_SUCCESS on success or PLIST_ERR_INVALID_ARG if the source dictionary does not contain any entry with given key or alt_source_key, or if it is not of type PLIST_STRING.