Class

PhodavVirtualDir

since: 2.5

Description [src]

final class Phodav.VirtualDir : GObject.Object
  implements Gio.File {
  /* No available fields */
}

An in-memory GFile implementation of a directory, which can be used with all GFile functions.

A PhodavVirtualDir does not represent any real file. Instead, it is a virtual element that can be used to build a directory tree structure in the memory. However, a PhodavVirtualDir can have a real file as its child.

The first building block of such tree must be phodav_virtual_dir_new_root(). Further directories can be added using phodav_virtual_dir_new_dir(). To link a real file as a child of a PhodavVirtualDir, use phodav_virtual_dir_attach_real_child().

PhodavVirtualDir allows you to easily share two resources when they have no common ancestor (like “C:\fileA” and “D:\fileB”) or when sharing their common ancestor would be impractical (sharing the whole “/” when the files are “/d1/d2/fileA” and “/d3/d4/fileB”).

It was designed primarily for the purposes of the SPICE project and hence the functionality is very narrow. If other projects find it handy as well, it could be extended quite easily.

A PhodavVirtualDir is not backed by a native file: g_file_is_native() returns FALSE on it. Its location is identified with a URI of the “virtual” scheme, built from the virtual path, for example “virtual:///dir/file”. These URIs identify the virtual directories, but they cannot be resolved back to a GFile: no GVfs is registered for the scheme.

Supported methods on virtual directories: - GET - PROPFIND - LOCK - UNLOCK

This concerns only the virtual directories. If you have a real GFile linked to a virtual directory, all the other methods are supported on such file.

You currently cannot delete a PhodavVirtualDir. Once the last reference to the root is dropped, the whole structure is destroyed. Children that have other references (non-internal) become dummies, otherwise they are freed.

Available since: 2.5

Hierarchy

hierarchy this PhodavVirtualDir implements_0 GFile this--implements_0 ancestor_0 GObject ancestor_0--this

Ancestors

Implements

Constructors

phodav_virtual_dir_new_root

Creates a new root virtual directory that acts as the ancestor of all further virtual directories.

since: 2.5

Instance methods

phodav_virtual_dir_attach_real_child

If successful, child becomes a descendant of parent.

since: 2.5

phodav_virtual_dir_new_dir

Tries to create a new virtual directory with the specified path. If it fails, error is set accordingly.

since: 2.5

phodav_virtual_dir_root_get_real
No description available.

since: 2.5

phodav_virtual_dir_root_set_real

If real_root_path is not NULL, root lists all files added with phodav_virtual_dir_new_dir() and phodav_virtual_dir_attach_real_child() as well as all files under real_root_path as its children.

since: 2.5

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Methods inherited from GFile (131)

Please see GFile for a full list of methods.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct PhodavVirtualDirClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.