Module plist

Module plist 

Source
Expand description

Contains logic and data structures used to parse and deserialize NSKeyedArchiver property list files into native Rust data structures.

The main entry point is parse_ns_keyed_archiver(). For normal property lists, use plist_as_dictionary().

§Overview

The NSKeyedArchiver format is a property list-based serialization protocol used by Apple’s Foundation framework. It stores object graphs in a keyed format, allowing for more flexible deserialization and better handling of object references compared to the older typedstream format.

§Origin

Introduced in Mac OS X 10.2 as part of the Foundation framework, NSKeyedArchiver replaced NSArchiver (typedstream) system as Apple’s primary object serialization mechanism.

§Features

  • Pure Rust implementation for efficient and safe deserialization
  • Support for both XML and binary property list formats
  • No dependencies on Apple frameworks
  • Robust error handling for malformed or invalid archives

Functions§

extract_array_key
Extract an array from a specific key in a collection
extract_bytes_key
Extract bytes from a specific key in a collection
extract_dict_idx
Extract a dictionary from a specific index in a collection
extract_dictionary
Extract a dictionary from a specific key in a collection
extract_int_key
Extract an int from a specific key in a collection
extract_string_key
Extract an &str from a specific key in a collection
get_bool_from_dict
Extract a bool from a key-value pair that looks like {key: true}
get_float_from_nested_dict
Extract a float from a key-value pair that looks like {key: {key: 1.2}}
get_owned_string_from_dict
Extract an owned string from a key-value pair that looks like {key: String("value")}
get_string_from_dict
Extract a string from a key-value pair that looks like {key: String("value")}
get_string_from_nested_dict
Extract a string from a key-value pair that looks like {key: {key: String("value")}}
get_value_from_dict
Extract an inner dict from a key-value pair that looks like {key: {key2: val}}
parse_ns_keyed_archiver
Serialize a message’s payload_data BLOB in the NSKeyedArchiver format to a Dictionary that follows the references in the XML document’s UID pointers. First, we find the root of the document, then walk the structure, promoting values to the places where their pointers are stored.
plist_as_dictionary
Extract a dictionary from table plist data.