VirtualFolder

Virtual folders play host to other folder types, including both concrete folder instances and subordinate virtual folders. You can build a (singly rooted) tree from a set of virtual and non- virtual folders, and treat them as though they were a combined or single entity. For example, listing the contents of such a tree is no different than listing the contents of a non-virtual tree - there's just potentially more nodes to traverse.

Constructors

this
this(const(char)[] name)

All folder must have a name. No '.' or '/' chars are permitted

Members

Functions

clear
VfsFolder clear()

Clear the entire subtree. Use with caution

close
VfsFolder close(bool commit)

Close and/or synchronize changes made to this folder. Each driver should take advantage of this as appropriate, perhaps combining multiple files together, or possibly copying to a remote location

dismount
VfsHost dismount(VfsFolder folder)

Unhook a child folder

error
string error(string msg)

Throw an exception

folder
VfsFolderEntry folder(const(char)[] path)

Return a folder representation of the given path. If the path-head does not refer to an immediate child, and does not match a symbolic link, it is considered unknown.

map
VfsHost map(VfsFile file, const(char)[] name)

Add a symbolic link to another file. These are referenced by file() alone, and do not show up in tree traversals

map
VfsHost map(VfsFolderEntry folder, const(char)[] name)

Add a symbolic link to another folder. These are referenced by folder() alone, and do not show up in tree traversals

mount
VfsHost mount(VfsFolder folder, const(char)[] name)

Add a child folder. The child cannot 'overlap' with others in the tree of the same type. Circular references across a tree of virtual folders are detected and trapped.

mount
VfsHost mount(VfsFolders group)

Add a set of child folders. The children cannot 'overlap' with others in the tree of the same type. Circular references are detected and trapped.

opApply
int opApply(int delegate(ref VfsFolder) dg)

Iterate over the set of immediate child folders. This is useful for reflecting the hierarchy

toString
string toString()

Return the (long) name of this folder. Virtual folders do not have long names, since they don't relate directly to a concrete folder instance

verify
void verify(VfsFolder folder, bool mounting)

Sweep the subtree of mountpoints, testing a new folder against all others. This propogates a folder test down throughout the tree, where each folder implementation should take appropriate action

Properties

file
const(char)[] file [@property setter]

Return a file representation of the given path. If the path-head does not refer to an immediate child folder, and does not match a symbolic link, it is considered unknown.

name
const(char)[] name [@property getter]

Return the (short) name of this folder

self
VfsFolders self [@property getter]

Returns a folder set containing only this one. Statistics are inclusive of entries within this folder only, which should be zero since symbolic links are not included

tree
VfsFolders tree [@property getter]

Returns a subtree of folders. Statistics are inclusive of all files and folders throughout the sub-tree

writable
bool writable [@property getter]

Returns true if all of the children are writable

Inherited Members

From VfsHost

mount
VfsHost mount(VfsFolder folder, const(char)[] name)

Add a child folder. The child cannot 'overlap' with others in the tree of the same type. Circular references across a tree of virtual folders are detected and trapped.

mount
VfsHost mount(VfsFolders group)

Add a set of child folders. The children cannot 'overlap' with others in the tree of the same type. Circular references are detected and trapped.

dismount
VfsHost dismount(VfsFolder folder)

Unhook a child folder

map
VfsHost map(VfsFile target, const(char)[] name)

Add a symbolic link to another file. These are referenced by file() alone, and do not show up in tree traversals

map
VfsHost map(VfsFolderEntry target, const(char)[] name)

Add a symbolic link to another folder. These are referenced by folder() alone, and do not show up in tree traversals

Meta