예제 #1
0
        public unsafe GLib.InputStream OpenStream(string path, GLib.ResourceLookupFlags lookup_flags)
        {
            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr error       = IntPtr.Zero;
            IntPtr raw_ret     = g_resource_open_stream(Handle, native_path, (int)lookup_flags, out error);

            GLib.InputStream ret = GLib.Object.GetObject(raw_ret) as GLib.InputStream;
            GLib.Marshaller.Free(native_path);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
예제 #2
0
        public unsafe string EnumerateChildren(string path, GLib.ResourceLookupFlags lookup_flags)
        {
            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr error       = IntPtr.Zero;
            IntPtr raw_ret     = g_resource_enumerate_children(Handle, native_path, (int)lookup_flags, out error);
            string ret         = GLib.Marshaller.PtrToStringGFree(raw_ret);

            GLib.Marshaller.Free(native_path);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
예제 #3
0
        public unsafe GLib.Bytes LookupData(string path, GLib.ResourceLookupFlags lookup_flags)
        {
            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr error       = IntPtr.Zero;
            IntPtr raw_ret     = g_resource_lookup_data(Handle, native_path, (int)lookup_flags, out error);

            GLib.Bytes ret = new GLib.Bytes(raw_ret);
            GLib.Marshaller.Free(native_path);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
예제 #4
0
        public unsafe bool GetInfo(string path, GLib.ResourceLookupFlags lookup_flags, out ulong size, out uint flags)
        {
            IntPtr  native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            UIntPtr native_size;
            IntPtr  error   = IntPtr.Zero;
            bool    raw_ret = g_resource_get_info(Handle, native_path, (int)lookup_flags, out native_size, out flags, out error);
            bool    ret     = raw_ret;

            GLib.Marshaller.Free(native_path);
            size = (ulong)native_size;
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }