public bool LoadFromFile(string file, KeyFileFlags flags) { IntPtr error; IntPtr native_file = Marshaller.StringToFilenamePtr(file); bool ret = g_key_file_load_from_file(Handle, native_file, (int)flags, out error); Marshaller.Free(native_file); if (error != IntPtr.Zero) { throw new GException(error); } return(ret); }
public bool LoadFromDataDirs(string file, out string full_path, KeyFileFlags flags) { IntPtr error; IntPtr native_full_path; IntPtr native_file = Marshaller.StringToPtrGStrdup(file); bool ret = g_key_file_load_from_data_dirs(Handle, native_file, out native_full_path, (int)flags, out error); Marshaller.Free(native_file); if (error != IntPtr.Zero) { throw new GException(error); } full_path = Marshaller.PtrToStringGFree(native_full_path); return(ret); }
public bool LoadFromData(byte[] data, KeyFileFlags flags) { if (data == null) { throw new ArgumentNullException("data"); } IntPtr error; bool ret = g_key_file_load_from_data(Handle, data, new UIntPtr((ulong)data.Length), (int)flags, out error); if (error != IntPtr.Zero) { throw new GException(error); } return(ret); }
public KeyFile (string file, KeyFileFlags flags) : this () { LoadFromFile (file, flags); }
public bool LoadFromFile (string file, KeyFileFlags flags) { IntPtr error; IntPtr native_file = Marshaller.StringToFilenamePtr (file); bool ret = g_key_file_load_from_file (Handle, native_file, (int) flags, out error); Marshaller.Free (native_file); if (error != IntPtr.Zero) throw new GException (error); return ret; }
public bool LoadFromDirs (string file, string[] search_dirs, out string full_path, KeyFileFlags flags) { IntPtr error; IntPtr native_full_path; IntPtr native_file = Marshaller.StringToPtrGStrdup (file); IntPtr native_search_dirs = Marshaller.StringArrayToStrvPtr (search_dirs); bool ret = g_key_file_load_from_dirs (Handle, native_file, native_search_dirs, out native_full_path, (int) flags, out error); Marshaller.Free (native_file); Marshaller.StrFreeV (native_search_dirs); if (error != IntPtr.Zero) throw new GException (error); full_path = Marshaller.PtrToStringGFree (native_full_path); return ret; }
public bool LoadFromData (byte[] data, KeyFileFlags flags) { if (data == null) throw new ArgumentNullException ("data"); IntPtr error; bool ret = g_key_file_load_from_data (Handle, data, new UIntPtr ((ulong) data.Length), (int) flags, out error); if (error != IntPtr.Zero) throw new GException (error); return ret; }
public KeyFile(string file, KeyFileFlags flags) : this() { LoadFromFile(file, flags); }