public static extern void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter);
/// <summary> /// Helper function to check the value of a PLIST_BOOL node. /// </summary> /// <param name="boolnode"> /// node of type PLIST_BOOL /// </param> /// <returns> /// 1 if the boolean node has a value of TRUE, 0 if FALSE, /// or -1 if the node is not of type PLIST_BOOL /// </returns> public virtual int plist_bool_val_is_true(PlistHandle boolnode) { return(PlistNativeMethods.plist_bool_val_is_true(boolnode)); }
/// <summary> /// Helper function to compare the value of a PLIST_REAL node against /// a given value. /// </summary> /// <param name="realnode"> /// node of type PLIST_REAL /// </param> /// <param name="cmpval"> /// value to compare against /// </param> /// <returns> /// 0 if the node's value and cmpval are (almost) equal, /// 1 if the node's value is greater than cmpval, /// or -1 if the node's value is less than cmpval. /// </returns> /// <remarks> /// WARNING: Comparing floating point values can give inaccurate /// results because of the nature of floating point values on computer /// systems. While this function is designed to be as accurate as /// possible, please don't rely on it too much. /// </remarks> public virtual int plist_real_val_compare(PlistHandle realnode, double cmpval) { return(PlistNativeMethods.plist_real_val_compare(realnode, cmpval)); }
public static void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out string key, out PlistHandle val) { System.Runtime.InteropServices.ICustomMarshaler keyMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr keyNative = System.IntPtr.Zero; PlistNativeMethods.plist_dict_next_item(node, iter, out keyNative, out val); key = ((string)keyMarshaler.MarshalNativeToManaged(keyNative)); keyMarshaler.CleanUpNativeData(keyNative); }
/// <summary> /// 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. /// </summary> /// <param name="plist_data"> /// a pointer to the memory buffer containing plist data. /// </param> /// <param name="length"> /// length of the buffer to read. /// </param> /// <param name="plist"> /// a pointer to the imported plist. /// </param> public virtual void plist_from_memory(string plistData, uint length, out PlistHandle plist) { PlistNativeMethods.plist_from_memory(plistData, length, out plist); plist.Api = this.Parent; }
public static extern void plist_from_memory([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string plistData, uint length, out PlistHandle plist);
public static extern PlistHandle plist_access_pathv(PlistHandle plist, uint length, System.IntPtr v);
public static extern PlistType plist_get_node_type(PlistHandle node);
public static extern void plist_get_string_val(PlistHandle node, out System.IntPtr val);
public static extern void plist_dict_merge(out PlistHandle target, PlistHandle source);
public static extern PlistHandle plist_get_parent(PlistHandle node);
public static extern void plist_dict_remove_item(PlistHandle node, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string key);
public static extern void plist_dict_get_item_key(PlistHandle node, out System.IntPtr key);
public static extern void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out System.IntPtr key, out PlistHandle val);
public static extern void plist_to_xml(PlistHandle plist, out System.IntPtr plistXml, ref uint length);
public static extern void plist_get_uint_val(PlistHandle node, ref ulong val);
public static extern void plist_to_bin(PlistHandle plist, out System.IntPtr plistBin, ref uint length);
public static extern void plist_get_data_val(PlistHandle node, out System.IntPtr val, ref ulong length);
public static extern PlistHandle plist_access_path(PlistHandle plist, uint length);
public static extern void plist_set_bool_val(PlistHandle node, char val);
public static extern sbyte plist_compare_node_value(PlistHandle nodeL, PlistHandle nodeR);
public static extern void plist_set_real_val(PlistHandle node, double val);
/// <summary> /// Import the #plist_t structure from binary format. /// </summary> /// <param name="plist_bin"> /// a pointer to the xml buffer. /// </param> /// <param name="length"> /// length of the buffer to read. /// </param> /// <param name="plist"> /// a pointer to the imported plist. /// </param> public virtual void plist_from_bin(string plistBin, uint length, out PlistHandle plist) { PlistNativeMethods.plist_from_bin(plistBin, length, out plist); plist.Api = this.Parent; }
public static extern void plist_set_data_val(PlistHandle node, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string val, ulong length);
/// <summary> /// Compare two node values /// </summary> /// <param name="node_l"> /// left node to compare /// </param> /// <param name="node_r"> /// rigth node to compare /// </param> /// <returns> /// TRUE is type and value match, FALSE otherwise. /// </returns> public virtual sbyte plist_compare_node_value(PlistHandle nodeL, PlistHandle nodeR) { return(PlistNativeMethods.plist_compare_node_value(nodeL, nodeR)); }
public static extern void plist_set_date_val(PlistHandle node, int sec, int usec);
/// <summary> /// Helper function to compare the value of a PLIST_UID node against /// a given value. /// </summary> /// <param name="uidnode"> /// node of type PLIST_UID /// </param> /// <param name="cmpval"> /// value to compare against /// </param> /// <returns> /// 0 if the node's value and cmpval are equal, /// 1 if the node's value is greater than cmpval, /// or -1 if the node's value is less than cmpval. /// </returns> public virtual int plist_uid_val_compare(PlistHandle uidnode, ulong cmpval) { return(PlistNativeMethods.plist_uid_val_compare(uidnode, cmpval)); }
public static extern void plist_set_uid_val(PlistHandle node, ulong val);
/// <summary> /// Helper function to compare the value of a PLIST_DATE node against /// a given set of seconds and fraction of a second since epoch. /// </summary> /// <param name="datenode"> /// node of type PLIST_DATE /// </param> /// <param name="cmpsec"> /// number of seconds since epoch to compare against /// </param> /// <param name="cmpusec"> /// fraction of a second in microseconds to compare against /// </param> /// <returns> /// 0 if the node's date is equal to the supplied values, /// 1 if the node's date is greater than the supplied values, /// or -1 if the node's date is less than the supplied values. /// </returns> public virtual int plist_date_val_compare(PlistHandle datenode, int cmpsec, int cmpusec) { return(PlistNativeMethods.plist_date_val_compare(datenode, cmpsec, cmpusec)); }
public static extern uint plist_dict_get_size(PlistHandle node);