/usr/include/d/gtkd-3/gio/Vfs.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gio.Vfs;
private import gio.FileIF;
private import gio.c.functions;
public import gio.c.types;
private import glib.Str;
private import gobject.ObjectG;
public import gtkc.giotypes;
/**
* Entry point for using GIO functionality.
*/
public class Vfs : ObjectG
{
/** the main Gtk struct */
protected GVfs* gVfs;
/** Get the main Gtk struct */
public GVfs* getVfsStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gVfs;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gVfs;
}
protected override void setStruct(GObject* obj)
{
gVfs = cast(GVfs*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GVfs* gVfs, bool ownedRef = false)
{
this.gVfs = gVfs;
super(cast(GObject*)gVfs, ownedRef);
}
/** */
public static GType getType()
{
return g_vfs_get_type();
}
/**
* Gets the default #GVfs for the system.
*
* Returns: a #GVfs.
*/
public static Vfs getDefault()
{
auto p = g_vfs_get_default();
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Vfs)(cast(GVfs*) p);
}
/**
* Gets the local #GVfs for the system.
*
* Returns: a #GVfs.
*/
public static Vfs getLocal()
{
auto p = g_vfs_get_local();
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Vfs)(cast(GVfs*) p);
}
/**
* Gets a #GFile for @path.
*
* Params:
* path = a string containing a VFS path.
*
* Returns: a #GFile.
* Free the returned object with g_object_unref().
*/
public FileIF getFileForPath(string path)
{
auto p = g_vfs_get_file_for_path(gVfs, Str.toStringz(path));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
}
/**
* Gets a #GFile for @uri.
*
* This operation never fails, but the returned object
* might not support any I/O operation if the URI
* is malformed or if the URI scheme is not supported.
*
* Params:
* uri = a string containing a URI
*
* Returns: a #GFile.
* Free the returned object with g_object_unref().
*/
public FileIF getFileForUri(string uri)
{
auto p = g_vfs_get_file_for_uri(gVfs, Str.toStringz(uri));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
}
/**
* Gets a list of URI schemes supported by @vfs.
*
* Returns: a %NULL-terminated array of strings.
* The returned array belongs to GIO and must
* not be freed or modified.
*/
public string[] getSupportedUriSchemes()
{
return Str.toStringArray(g_vfs_get_supported_uri_schemes(gVfs));
}
/**
* Checks if the VFS is active.
*
* Returns: %TRUE if construction of the @vfs was successful
* and it is now active.
*/
public bool isActive()
{
return g_vfs_is_active(gVfs) != 0;
}
/**
* This operation never fails, but the returned object might
* not support any I/O operations if the @parse_name cannot
* be parsed by the #GVfs module.
*
* Params:
* parseName = a string to be parsed by the VFS module.
*
* Returns: a #GFile for the given @parse_name.
* Free the returned object with g_object_unref().
*/
public FileIF parseName(string parseName)
{
auto p = g_vfs_parse_name(gVfs, Str.toStringz(parseName));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
}
/**
* Registers @uri_func and @parse_name_func as the #GFile URI and parse name
* lookup functions for URIs with a scheme matching @scheme.
* Note that @scheme is registered only within the running application, as
* opposed to desktop-wide as it happens with GVfs backends.
*
* When a #GFile is requested with an URI containing @scheme (e.g. through
* g_file_new_for_uri()), @uri_func will be called to allow a custom
* constructor. The implementation of @uri_func should not be blocking, and
* must not call g_vfs_register_uri_scheme() or g_vfs_unregister_uri_scheme().
*
* When g_file_parse_name() is called with a parse name obtained from such file,
* @parse_name_func will be called to allow the #GFile to be created again. In
* that case, it's responsibility of @parse_name_func to make sure the parse
* name matches what the custom #GFile implementation returned when
* g_file_get_parse_name() was previously called. The implementation of
* @parse_name_func should not be blocking, and must not call
* g_vfs_register_uri_scheme() or g_vfs_unregister_uri_scheme().
*
* It's an error to call this function twice with the same scheme. To unregister
* a custom URI scheme, use g_vfs_unregister_uri_scheme().
*
* Params:
* scheme = an URI scheme, e.g. "http"
* uriFunc = a #GVfsFileLookupFunc
* uriData = custom data passed to be passed to @uri_func, or %NULL
* uriDestroy = function to be called when unregistering the
* URI scheme, or when @vfs is disposed, to free the resources used
* by the URI lookup function
* parseNameFunc = a #GVfsFileLookupFunc
* parseNameData = custom data passed to be passed to
* @parse_name_func, or %NULL
* parseNameDestroy = function to be called when unregistering the
* URI scheme, or when @vfs is disposed, to free the resources used
* by the parse name lookup function
*
* Returns: %TRUE if @scheme was successfully registered, or %FALSE if a handler
* for @scheme already exists.
*
* Since: 2.50
*/
public bool registerUriScheme(string scheme, GVfsFileLookupFunc uriFunc, void* uriData, GDestroyNotify uriDestroy, GVfsFileLookupFunc parseNameFunc, void* parseNameData, GDestroyNotify parseNameDestroy)
{
return g_vfs_register_uri_scheme(gVfs, Str.toStringz(scheme), uriFunc, uriData, uriDestroy, parseNameFunc, parseNameData, parseNameDestroy) != 0;
}
/**
* Unregisters the URI handler for @scheme previously registered with
* g_vfs_register_uri_scheme().
*
* Params:
* scheme = an URI scheme, e.g. "http"
*
* Returns: %TRUE if @scheme was successfully unregistered, or %FALSE if a
* handler for @scheme does not exist.
*
* Since: 2.50
*/
public bool unregisterUriScheme(string scheme)
{
return g_vfs_unregister_uri_scheme(gVfs, Str.toStringz(scheme)) != 0;
}
}
|