/// <summary> /// Creates a new <see cref="PlistDictIterHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <param name="ownsHandle"> /// <see langword="true"/> to reliably release the handle during the finalization phase; <see langword="false"/> to prevent reliable release (not recommended). /// </param> /// <returns> /// </returns> public static PlistDictIterHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle) { PlistDictIterHandle safeHandle = new PlistDictIterHandle(ownsHandle); safeHandle.SetHandle(unsafeHandle); return(safeHandle); }
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> /// Increment iterator of a #PLIST_DICT node. /// </summary> /// <param name="node"> /// The node of type #PLIST_DICT /// </param> /// <param name="iter"> /// Iterator of the dictionary /// </param> /// <param name="key"> /// Location to store the key, or NULL. The caller is responsible /// for freeing the the returned string. /// </param> /// <param name="val"> /// Location to store the value, or NULL. The caller must *not* /// free the returned value. Will be set to NULL when no more /// key/value pairs are left to iterate. /// </param> public virtual void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out string key, out PlistHandle val) { PlistNativeMethods.plist_dict_next_item(node, iter, out key, out val); val.Api = this.Parent; }
/// <summary> /// Create an iterator of a #PLIST_DICT node. /// The allocated iterator should be freed with the standard free function. /// </summary> /// <param name="node"> /// The node of type #PLIST_DICT. /// </param> /// <param name="iter"> /// Location to store the iterator for the dictionary. /// </param> public virtual void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter) { PlistNativeMethods.plist_dict_new_iter(node, out iter); iter.Api = this.Parent; }
public static extern void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out System.IntPtr key, out PlistHandle val);
public static extern void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter);
public static PlistDictIterHandle DangerousCreate(System.IntPtr unsafeHandle) { return(PlistDictIterHandle.DangerousCreate(unsafeHandle, true)); }
public object MarshalNativeToManaged(System.IntPtr nativeData) { return(PlistDictIterHandle.DangerousCreate(nativeData, false)); }