Gio.Vfs - Classes - Gio 2.0 (original) (raw)
g GObject.Object GObject.Object Gio.Vfs Gio.Vfs GObject.Object->Gio.Vfs
Subclasses:
None
Methods¶
Inherited:
Structs:
class | get_default () |
---|---|
class | get_local () |
get_file_for_path (path) | |
get_file_for_uri (uri) | |
get_supported_uri_schemes () | |
is_active () | |
parse_name (parse_name) | |
register_uri_scheme (scheme, uri_func, uri_data, parse_name_func, *parse_name_data) | |
unregister_uri_scheme (scheme) |
Virtual Methods¶
Inherited:
do_add_writable_namespaces (list) |
---|
do_get_file_for_path (path) |
do_get_file_for_uri (uri) |
do_get_supported_uri_schemes () |
do_is_active () |
do_local_file_add_info (filename, device, attribute_matcher, info, cancellable, extra_data, free_extra_data) |
do_local_file_moved (source, dest) |
do_local_file_removed (filename) |
do_local_file_set_attributes (filename, info, flags, cancellable) |
do_parse_name (parse_name) |
Properties¶
None
Signals¶
Inherited:
Fields¶
Inherited:
Name | Type | Access | Description |
---|---|---|---|
parent_instance | GObject.Object | r |
Class Details¶
class Gio.Vfs(**kwargs)¶
Bases:
Abstract:
No
Structure:
Entry point for using GIO functionality.
classmethod get_default()[source]¶
Returns:
a Gio.Vfs, which will be the local file system Gio.Vfs if no other implementation is available.
Return type:
Gets the default Gio.Vfs for the system.
classmethod get_local()[source]¶
Returns:
a Gio.Vfs.
Return type:
Gets the local Gio.Vfs for the system.
get_file_for_path(path)[source]¶
Parameters:
path (str) – a string containing a VFS path.
Returns:
a Gio.File. Free the returned object with GObject.Object.unref().
Return type:
Gets a Gio.File for path.
get_file_for_uri(uri)[source]¶
Parameters:
uri (str) – a string containing a URI
Returns:
a Gio.File. Free the returned object with GObject.Object.unref().
Return type:
Gets a Gio.File 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.
get_supported_uri_schemes()[source]¶
Returns:
a None-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
Return type:
[str]
Gets a list of URI schemes supported by self.
Returns:
True if construction of the self was successful and it is now active.
Return type:
Checks if the VFS is active.
parse_name(parse_name)[source]¶
Parameters:
parse_name (str) – a string to be parsed by the VFS module.
Returns:
a Gio.File for the given parse_name. Free the returned object with GObject.Object.unref().
Return type:
This operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the Gio.Vfs module.
register_uri_scheme(scheme, uri_func, uri_data, parse_name_func, *parse_name_data)[source]¶
Parameters:
- scheme (str) – an URI scheme, e.g. “http”
- uri_func (Gio.VfsFileLookupFunc or None) – a Gio.VfsFileLookupFunc
- uri_data (object or None) – custom data passed to be passed to uri_func, or None
- parse_name_func (Gio.VfsFileLookupFunc or None) – a Gio.VfsFileLookupFunc
- parse_name_data (object or None) – custom data passed to be passed toparse_name_func, or None
Returns:
True if scheme was successfully registered, or False if a handler for scheme already exists.
Return type:
Registers uri_func and parse_name_func as the Gio.File 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 Gio.Vfs backends.
When a Gio.File is requested with an URI containing scheme (e.g. throughGio.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 Gio.Vfs.register_uri_scheme() or Gio.Vfs.unregister_uri_scheme().
When Gio.File.parse_name() is called with a parse name obtained from such file,parse_name_func will be called to allow the Gio.File to be created again. In that case, it’s responsibility of parse_name_func to make sure the parse name matches what the custom Gio.File implementation returned whenGio.File.get_parse_name() was previously called. The implementation ofparse_name_func should not be blocking, and must not callGio.Vfs.register_uri_scheme() or Gio.Vfs.unregister_uri_scheme().
It’s an error to call this function twice with the same scheme. To unregister a custom URI scheme, use Gio.Vfs.unregister_uri_scheme().
New in version 2.50.
unregister_uri_scheme(scheme)[source]¶
Parameters:
scheme (str) – an URI scheme, e.g. “http”
Returns:
True if scheme was successfully unregistered, or False if a handler for scheme does not exist.
Return type:
Unregisters the URI handler for scheme previously registered withGio.Vfs.register_uri_scheme().
New in version 2.50.
do_add_writable_namespaces(list) virtual¶
Parameters:
list (Gio.FileAttributeInfoList) –
do_get_file_for_path(path) virtual¶
Parameters:
path (str) – a string containing a VFS path.
Returns:
a Gio.File. Free the returned object with GObject.Object.unref().
Return type:
Gets a Gio.File for path.
do_get_file_for_uri(uri) virtual¶
Parameters:
uri (str) – a string containing a URI
Returns:
a Gio.File. Free the returned object with GObject.Object.unref().
Return type:
Gets a Gio.File 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.
do_get_supported_uri_schemes() virtual¶
Returns:
a None-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
Return type:
[str]
Gets a list of URI schemes supported by vfs.
do_is_active() virtual¶
Returns:
True if construction of the vfs was successful and it is now active.
Return type:
Checks if the VFS is active.
do_local_file_add_info(filename, device, attribute_matcher, info, cancellable, extra_data, free_extra_data) virtual¶
Parameters:
- filename (str) –
- device (int) –
- attribute_matcher (Gio.FileAttributeMatcher) –
- info (Gio.FileInfo) –
- cancellable (Gio.Cancellable or None) –
- extra_data (object or None) –
- free_extra_data (GLib.DestroyNotify) –
do_local_file_moved(source, dest) virtual¶
Parameters:
do_local_file_removed(filename) virtual¶
Parameters:
filename (str) –
do_local_file_set_attributes(filename, info, flags, cancellable) virtual¶
Parameters:
- filename (str) –
- info (Gio.FileInfo) –
- flags (Gio.FileQueryInfoFlags) –
- cancellable (Gio.Cancellable or None) –
Return type:
do_parse_name(parse_name) virtual¶
Parameters:
parse_name (str) – a string to be parsed by the VFS module.
Returns:
a Gio.File for the given parse_name. Free the returned object with GObject.Object.unref().
Return type:
This operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the Gio.Vfs module.