libplist  2.7.0
API Documentation - Return to Homepage

◆ plist_dict_get_bool()

PLIST_API uint8_t plist_dict_get_bool ( plist_t  dict,
const char *  key 
)

Get a boolean value from a given PLIST_DICT entry.

The value node can be of type PLIST_BOOLEAN, but also PLIST_STRING (either 'true' or 'false'), PLIST_INT with a numerical value of 0 or >= 1, or PLIST_DATA with a single byte with a value of 0 or >= 1.

Note
This function returns 0 if the dictionary does not contain an entry for the given key, if the value node is of any other than the above mentioned type, or has any mismatching value.
Parameters
dictA node of type PLIST_DICT
keyThe key to look for in dict
Returns
0 or 1 depending on the value of the node.