Interface IPlistApi
Namespace: iMobileDevice.Plist
Assembly: iMobileDevice-net.dll
Syntax
public interface IPlistApi
Properties
| Improve this Doc View SourceParent
Gets or sets the
Declaration
ILibiMobileDevice Parent { get; }
Property Value
Type | Description |
---|---|
ILibiMobileDevice |
Methods
| Improve this Doc View Sourceplist_access_path(PlistHandle, UInt32)
Get a node from its path. Each path element depends on the associated father node type. For Dictionaries, var args are casted to const char*, for arrays, var args are caster to uint32_t Search is breath first order.
Declaration
PlistHandle plist_access_path(PlistHandle plist, uint length)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | plist | the node to access result from. |
System.UInt32 | length | length of the path to access |
Returns
Type | Description |
---|---|
PlistHandle | the value to access. |
plist_access_pathv(PlistHandle, UInt32, IntPtr)
Variadic version of #plist_access_path.
Declaration
PlistHandle plist_access_pathv(PlistHandle plist, uint length, IntPtr v)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | plist | the node to access result from. |
System.UInt32 | length | length of the path to access |
System.IntPtr | v | list of array's index and dic'st key |
Returns
Type | Description |
---|---|
PlistHandle | the value to access. |
plist_array_append_item(PlistHandle, PlistHandle)
Append a new item at the end of a #PLIST_ARRAY node.
Declaration
void plist_array_append_item(PlistHandle node, PlistHandle item)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
PlistHandle | item | the new item. The array is responsible for freeing item when it is no longer needed. |
plist_array_get_item(PlistHandle, UInt32)
Get the nth item in a #PLIST_ARRAY node.
Declaration
PlistHandle plist_array_get_item(PlistHandle node, uint n)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
System.UInt32 | n | the index of the item to get. Range is [0, array_size[ |
Returns
Type | Description |
---|---|
PlistHandle | the nth item or NULL if node is not of type #PLIST_ARRAY |
plist_array_get_item_index(PlistHandle)
Get the index of an item. item must be a member of a #PLIST_ARRAY node.
Declaration
uint plist_array_get_item_index(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
Returns
Type | Description |
---|---|
System.UInt32 | the node index |
plist_array_get_size(PlistHandle)
Get size of a #PLIST_ARRAY node.
Declaration
uint plist_array_get_size(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
Returns
Type | Description |
---|---|
System.UInt32 | size of the #PLIST_ARRAY node |
plist_array_insert_item(PlistHandle, PlistHandle, UInt32)
Insert a new item at position n in a #PLIST_ARRAY node.
Declaration
void plist_array_insert_item(PlistHandle node, PlistHandle item, uint n)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
PlistHandle | item | the new item to insert. The array is responsible for freeing item when it is no longer needed. |
System.UInt32 | n | The position at which the node will be stored. Range is [0, array_size[. Assert if n is not in range. |
plist_array_remove_item(PlistHandle, UInt32)
Remove an existing position in a #PLIST_ARRAY node. Removed position will be freed using #plist_free.
Declaration
void plist_array_remove_item(PlistHandle node, uint n)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
System.UInt32 | n | The position to remove. Range is [0, array_size[. Assert if n is not in range. |
plist_array_set_item(PlistHandle, PlistHandle, UInt32)
Set the nth item in a #PLIST_ARRAY node. The previous item at index n will be freed using #plist_free
Declaration
void plist_array_set_item(PlistHandle node, PlistHandle item, uint n)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_ARRAY |
PlistHandle | item | the new item at index n. The array is responsible for freeing item when it is no longer needed. |
System.UInt32 | n | the index of the item to get. Range is [0, array_size[. Assert if n is not in range. |
plist_compare_node_value(PlistHandle, PlistHandle)
Compare two node values
Declaration
sbyte plist_compare_node_value(PlistHandle nodeL, PlistHandle nodeR)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | nodeL | |
PlistHandle | nodeR |
Returns
Type | Description |
---|---|
System.SByte | TRUE is type and value match, FALSE otherwise. |
plist_copy(PlistHandle)
Return a copy of passed node and it's children
Declaration
PlistHandle plist_copy(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the plist to copy |
Returns
Type | Description |
---|---|
PlistHandle | copied plist |
plist_dict_get_item(PlistHandle, String)
Get the nth item in a #PLIST_DICT node.
Declaration
PlistHandle plist_dict_get_item(PlistHandle node, string key)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
System.String | key | the identifier of the item to get. |
Returns
Type | Description |
---|---|
PlistHandle | the item or NULL if node is not of type #PLIST_DICT. The caller should not free the returned node. |
plist_dict_get_item_key(PlistHandle, out String)
Get key associated to an item. Item must be member of a dictionary
Declaration
void plist_dict_get_item_key(PlistHandle node, out string key)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | key | a location to store the key. The caller is responsible for freeing the returned string. |
plist_dict_get_size(PlistHandle)
Get size of a #PLIST_DICT node.
Declaration
uint plist_dict_get_size(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
Returns
Type | Description |
---|---|
System.UInt32 | size of the #PLIST_DICT node |
plist_dict_insert_item(PlistHandle, String, PlistHandle)
Insert a new item into a #PLIST_DICT node.
Declaration
void plist_dict_insert_item(PlistHandle node, string key, PlistHandle item)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
System.String | key | The identifier of the item to insert. |
PlistHandle | item | the new item to insert |
plist_dict_merge(out PlistHandle, PlistHandle)
Merge a dictionary into another. This will add all key/value pairs from the source dictionary to the target dictionary, overwriting any existing key/value pairs that are already present in target.
Declaration
void plist_dict_merge(out PlistHandle target, PlistHandle source)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | target | pointer to an existing node of type #PLIST_DICT |
PlistHandle | source | node of type #PLIST_DICT that should be merged into target |
plist_dict_new_iter(PlistHandle, out PlistDictIterHandle)
Create an iterator of a #PLIST_DICT node. The allocated iterator should be freed with the standard free function.
Declaration
void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
PlistDictIterHandle | iter | iterator of the #PLIST_DICT node |
plist_dict_next_item(PlistHandle, PlistDictIterHandle, out String, out PlistHandle)
Increment iterator of a #PLIST_DICT node.
Declaration
void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out string key, out PlistHandle val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
PlistDictIterHandle | iter | iterator of the dictionary |
System.String | key | a location to store the key, or NULL. The caller is responsible for freeing the the returned string. |
PlistHandle | val | a location to store the value, or NULL. The caller should not free the returned value. |
plist_dict_remove_item(PlistHandle, String)
Remove an existing position in a #PLIST_DICT node. Removed position will be freed using #plist_free
Declaration
void plist_dict_remove_item(PlistHandle node, string key)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
System.String | key | The identifier of the item to remove. Assert if identifier is not present. |
plist_dict_set_item(PlistHandle, String, PlistHandle)
Set item identified by key in a #PLIST_DICT node. The previous item identified by key will be freed using #plist_free. If there is no item for the given key a new item will be inserted.
Declaration
void plist_dict_set_item(PlistHandle node, string key, PlistHandle item)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node of type #PLIST_DICT |
System.String | key | the identifier of the item to set. |
PlistHandle | item | the new item associated to key |
plist_free(IntPtr)
Destruct a plist_t node and all its children recursively
Declaration
void plist_free(IntPtr plist)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | plist | the plist to free |
plist_from_bin(String, UInt32, out PlistHandle)
Import the #plist_t structure from binary format.
Declaration
void plist_from_bin(string plistBin, uint length, out PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
System.String | plistBin | |
System.UInt32 | length | length of the buffer to read. |
PlistHandle | plist | a pointer to the imported plist. |
plist_from_memory(String, UInt32, out PlistHandle)
Import the #plist_t structure from memory data. This method will look at the first bytes of plist_data to determine if plist_data contains a binary or XML plist.
Declaration
void plist_from_memory(string plistData, uint length, out PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
System.String | plistData | |
System.UInt32 | length | length of the buffer to read. |
PlistHandle | plist | a pointer to the imported plist. |
plist_from_xml(String, UInt32, out PlistHandle)
Import the #plist_t structure from XML format.
Declaration
void plist_from_xml(string plistXml, uint length, out PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
System.String | plistXml | |
System.UInt32 | length | length of the buffer to read. |
PlistHandle | plist | a pointer to the imported plist. |
plist_get_bool_val(PlistHandle, ref Char)
Get the value of a #PLIST_BOOLEAN node. This function does nothing if node is not of type #PLIST_BOOLEAN
Declaration
void plist_get_bool_val(PlistHandle node, ref char val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Char | val | a pointer to a uint8_t variable. |
plist_get_data_val(PlistHandle, out String, ref UInt64)
Get the value of a #PLIST_DATA node. This function does nothing if node is not of type #PLIST_DATA
Declaration
void plist_get_data_val(PlistHandle node, out string val, ref ulong length)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | a pointer to an unallocated char buffer. This function allocates the memory, caller is responsible for freeing it. |
System.UInt64 | length | the length of the buffer |
plist_get_date_val(PlistHandle, ref Int32, ref Int32)
Get the value of a #PLIST_DATE node. This function does nothing if node is not of type #PLIST_DATE
Declaration
void plist_get_date_val(PlistHandle node, ref int sec, ref int usec)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Int32 | sec | a pointer to an int32_t variable. Represents the number of seconds since 01/01/2001. |
System.Int32 | usec | a pointer to an int32_t variable. Represents the number of microseconds |
plist_get_key_val(PlistHandle, out String)
Get the value of a #PLIST_KEY node. This function does nothing if node is not of type #PLIST_KEY
Declaration
void plist_get_key_val(PlistHandle node, out string val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | a pointer to a C-string. This function allocates the memory, caller is responsible for freeing it. |
plist_get_node_type(PlistHandle)
Get the #plist_type of a node.
Declaration
PlistType plist_get_node_type(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
Returns
Type | Description |
---|---|
PlistType | the type of the node |
plist_get_parent(PlistHandle)
Get the parent of a node
Declaration
PlistHandle plist_get_parent(PlistHandle node)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the parent (NULL if node is root) |
Returns
Type | Description |
---|---|
PlistHandle |
plist_get_real_val(PlistHandle, ref Double)
Get the value of a #PLIST_REAL node. This function does nothing if node is not of type #PLIST_REAL
Declaration
void plist_get_real_val(PlistHandle node, ref double val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Double | val | a pointer to a double variable. |
plist_get_string_val(PlistHandle, out String)
Get the value of a #PLIST_STRING node. This function does nothing if node is not of type #PLIST_STRING
Declaration
void plist_get_string_val(PlistHandle node, out string val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | a pointer to a C-string. This function allocates the memory, caller is responsible for freeing it. Data is UTF-8 encoded. |
plist_get_uid_val(PlistHandle, ref UInt64)
Get the value of a #PLIST_UID node. This function does nothing if node is not of type #PLIST_UID
Declaration
void plist_get_uid_val(PlistHandle node, ref ulong val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.UInt64 | val | a pointer to a uint64_t variable. |
plist_get_uint_val(PlistHandle, ref UInt64)
Get the value of a #PLIST_UINT node. This function does nothing if node is not of type #PLIST_UINT
Declaration
void plist_get_uint_val(PlistHandle node, ref ulong val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.UInt64 | val | a pointer to a uint64_t variable. |
plist_is_binary(String, UInt32)
Test if in-memory plist data is binary or XML This method will look at the first bytes of plist_data to determine if plist_data contains a binary or XML plist. This method is not validating the whole memory buffer to check if the content is truly a plist, it's only using some heuristic on the first few bytes of plist_data.
Declaration
int plist_is_binary(string plistData, uint length)
Parameters
Type | Name | Description |
---|---|---|
System.String | plistData | |
System.UInt32 | length | length of the buffer to read. |
Returns
Type | Description |
---|---|
System.Int32 | 1 if the buffer is a binary plist, 0 otherwise. |
plist_new_array()
Create a new root plist_t type #PLIST_ARRAY
Declaration
PlistHandle plist_new_array()
Returns
Type | Description |
---|---|
PlistHandle | the created plist |
plist_new_bool(Char)
Create a new plist_t type #PLIST_BOOLEAN
Declaration
PlistHandle plist_new_bool(char val)
Parameters
Type | Name | Description |
---|---|---|
System.Char | val | the boolean value, 0 is false, other values are true. |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_data(String, UInt64)
Create a new plist_t type #PLIST_DATA
Declaration
PlistHandle plist_new_data(string val, ulong length)
Parameters
Type | Name | Description |
---|---|---|
System.String | val | the binary buffer |
System.UInt64 | length | the length of the buffer |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_date(Int32, Int32)
Create a new plist_t type #PLIST_DATE
Declaration
PlistHandle plist_new_date(int sec, int usec)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sec | the number of seconds since 01/01/2001 |
System.Int32 | usec | the number of microseconds |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_dict()
Create a new root plist_t type #PLIST_DICT
Declaration
PlistHandle plist_new_dict()
Returns
Type | Description |
---|---|
PlistHandle | the created plist |
plist_new_real(Double)
Create a new plist_t type #PLIST_REAL
Declaration
PlistHandle plist_new_real(double val)
Parameters
Type | Name | Description |
---|---|---|
System.Double | val | the real value |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_string(String)
Create a new plist_t type #PLIST_STRING
Declaration
PlistHandle plist_new_string(string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | val | the sting value, encoded in UTF8. |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_uid(UInt64)
Create a new plist_t type #PLIST_UID
Declaration
PlistHandle plist_new_uid(ulong val)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | val | the unsigned integer value |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_new_uint(UInt64)
Create a new plist_t type #PLIST_UINT
Declaration
PlistHandle plist_new_uint(ulong val)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | val | the unsigned integer value |
Returns
Type | Description |
---|---|
PlistHandle | the created item |
plist_set_bool_val(PlistHandle, Char)
Set the value of a node. Forces type of node to #PLIST_BOOLEAN
Declaration
void plist_set_bool_val(PlistHandle node, char val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Char | val | the boolean value |
plist_set_data_val(PlistHandle, String, UInt64)
Set the value of a node. Forces type of node to #PLIST_DATA
Declaration
void plist_set_data_val(PlistHandle node, string val, ulong length)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | the binary buffer. The buffer is copied when set and will be freed by the node. |
System.UInt64 | length | the length of the buffer |
plist_set_date_val(PlistHandle, Int32, Int32)
Set the value of a node. Forces type of node to #PLIST_DATE
Declaration
void plist_set_date_val(PlistHandle node, int sec, int usec)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Int32 | sec | the number of seconds since 01/01/2001 |
System.Int32 | usec | the number of microseconds |
plist_set_key_val(PlistHandle, String)
Set the value of a node. Forces type of node to #PLIST_KEY
Declaration
void plist_set_key_val(PlistHandle node, string val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | the key value |
plist_set_real_val(PlistHandle, Double)
Set the value of a node. Forces type of node to #PLIST_REAL
Declaration
void plist_set_real_val(PlistHandle node, double val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.Double | val | the real value |
plist_set_string_val(PlistHandle, String)
Set the value of a node. Forces type of node to #PLIST_STRING
Declaration
void plist_set_string_val(PlistHandle node, string val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.String | val | the string value. The string is copied when set and will be freed by the node. |
plist_set_uid_val(PlistHandle, UInt64)
Set the value of a node. Forces type of node to #PLIST_UID
Declaration
void plist_set_uid_val(PlistHandle node, ulong val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.UInt64 | val | the unsigned integer value |
plist_set_uint_val(PlistHandle, UInt64)
Set the value of a node. Forces type of node to #PLIST_UINT
Declaration
void plist_set_uint_val(PlistHandle node, ulong val)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | node | the node |
System.UInt64 | val | the unsigned integer value |
plist_to_bin(PlistHandle, out String, ref UInt32)
Export the #plist_t structure to binary format.
Declaration
void plist_to_bin(PlistHandle plist, out string plistBin, ref uint length)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | plist | the root node to export |
System.String | plistBin | |
System.UInt32 | length | a pointer to an uint32_t variable. Represents the length of the allocated buffer. |
plist_to_bin_free(IntPtr)
Frees the memory allocated by plist_to_bin
Declaration
void plist_to_bin_free(IntPtr plistBin)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | plistBin |
plist_to_xml(PlistHandle, out String, ref UInt32)
Export the #plist_t structure to XML format.
Declaration
void plist_to_xml(PlistHandle plist, out string plistXml, ref uint length)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | plist | the root node to export |
System.String | plistXml | |
System.UInt32 | length | a pointer to an uint32_t variable. Represents the length of the allocated buffer. |
plist_to_xml_free(IntPtr)
Frees the memory allocated by plist_to_xml
Declaration
void plist_to_xml_free(IntPtr plistXml)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | plistXml |