tango.io.vfs.VirtualFolder

License:

BSD style: see license.txt

Version:

Oct 2007: Initial version

Author:

Kris
class VirtualFolder : VfsHost #
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.
this(char[] name) #
All folder must have a name. No '.' or '/' chars are permitted
char[] name() [final] #
Return the (short) name of this folder
char[] toString() [final] #
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
VfsHost mount(VfsFolder folder, char[] name = null) #
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.
The second argument represents an optional name that the mount should be known as, instead of the name exposed by the provided folder (it is not an alias).
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.
VfsHost dismount(VfsFolder folder) #
Unhook a child folder
VfsHost map(VfsFile file, char[] name) [final] #
Add a symbolic link to another file. These are referenced by file() alone, and do not show up in tree traversals
VfsHost map(VfsFolderEntry folder, char[] name) [final] #
Add a symbolic link to another folder. These are referenced by folder() alone, and do not show up in tree traversals
int opApply(int delegate(ref VfsFolder) dg) [final] #
Iterate over the set of immediate child folders. This is useful for reflecting the hierarchy
VfsFolderEntry folder(char[] path) [final] #
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.
VfsFile file(char[] path) #
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.
VfsFolder clear() [final] #
Clear the entire subtree. Use with caution
bool writable() [final] #
Returns true if all of the children are writable
VfsFolders self() [final] #
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
VfsFolders tree() [final] #
Returns a subtree of folders. Statistics are inclusive of all files and folders throughout the sub-tree
void verify(VfsFolder folder, bool mounting) [final] #
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
VfsFolder close(bool commit = true) #
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
char[] error(char[] msg) [package, final] #
Throw an exception
void validate(char[] name) [private, final] #
Validate path names
class VirtualFolders : VfsFolders [private] #
A set of virtual folders. For a sub-tree, we compose the results of all our subordinates and delegate subsequent request to that group.
this() [private] #
Create a subset group
this(VirtualFolder root, bool recurse) [private] #
Create a folder group including the provided folder and (optionally) all child folders
int opApply(int delegate(ref VfsFolder) dg) [final] #
Iterate over the set of contained VfsFolder instances
uint files() [final] #
Return the number of files in this group
ulong bytes() [final] #
Return the total size of all files in this group
uint folders() [final] #
Return the number of folders in this group
uint entries() [final] #
Return the total number of entries in this group
VfsFolders subset(char[] pattern) [final] #
Return a subset of folders matching the given pattern
VfsFiles catalog(char[] pattern) [final] #
Return a set of files matching the given pattern
VfsFiles catalog(VfsFilter filter = null) [final] #
Returns a set of files conforming to the given filter
class VirtualFiles : VfsFiles [private] #
A set of virtual files, represented by composing the results of the given set of folders. Subsequent calls are delegated to the results from those folders
this(VirtualFolders host, VfsFilter filter) [private] #
int opApply(int delegate(ref VfsFile) dg) [final] #
Iterate over the set of contained VfsFile instances
uint files() [final] #
Return the total number of entries
ulong bytes() [final] #
Return the total size of all files