tango.io.vfs.FileFolder

License:

BSD style: see license.txt

Version:

Oct 2007: Initial version

Author:

Kris
class FileFolder : VfsFolder #
Represents a physical folder in a file system. Use one of these to address specific paths (sub-trees) within the file system.
this(char[] path, bool create = false) #
Create a file folder with the given path.
Option 'create' will create the path when set true, or reference an existing path otherwise
this(char[] path, char[] name) [private] #
create a FileFolder as a Group member
this(FileFolder parent, char[] name, bool create = false) [private] #
explicitly create() or open() a named folder
char[] name() [final] #
Return a short name
char[] toString() [final] #
Return a long name
void verify(VfsFolder folder, bool mounting) [final] #
A folder is being added or removed from the hierarchy. Use this to test for validity (or whatever) and throw exceptions as necessary
Here we test for folder overlap, and bail-out when found.
VfsFile file(char[] name) [final] #
Return a contained file representation
VfsFolderEntry folder(char[] path) [final] #
Return a contained folder representation
VfsFolder clear() [final] #
Remove the folder subtree. Use with care!
bool writable() [final] #
Is folder writable?
VfsFolders self() [final] #
Returns content information about this folder
VfsFolders tree() [final] #
Returns a subtree of folders matching the given name
int opApply(int delegate(ref VfsFolder) dg) [final] #
Iterate over the set of immediate child folders. This is useful for reflecting the hierarchy
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
FileFolder[] folders(bool collect) [private] #
Sweep owned folders
char[][] files(ref VfsStats stats, VfsFilter filter = null) [private] #
Sweep owned files
char[] error(char[] msg) [private] #
Throw an exception
char[] open(char[] path, bool create) [private] #
Create or open the given path, and detect path errors
class FileGroup : VfsFiles #
Represents a group of files (need this declared here to avoid a bunch of bizarre compiler warnings)
this(FolderGroup host, VfsFilter filter) #
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
class FolderGroup : VfsFolders [private] #
A set of folders representing a selection. This is where file selection is made, and pattern-matched folder subsets can be extracted. You need one of these to expose statistics (such as file or folder count) of a selected folder group
this() [private] #
Create a subset group
this(FileFolder 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
FileGroup catalog(char[] pattern) [final] #
Return a set of files matching the given pattern
FileGroup catalog(VfsFilter filter = null) [final] #
Returns a set of files conforming to the given filter
FileFolder[] scan(FileFolder root, bool recurse) [private, final] #
Internal routine to traverse the folder tree
class FolderHost : VfsFolderEntry [private] #
A host for folders, currently used to harbor create() and open() methods only
this(FileFolder parent, char[] path) [private] #
VfsFolder create() [final] #
VfsFolder open() [final] #
bool exists() #
Test to see if a folder exists
class FileHost : VfsFile [private] #
Represents things you can do with a file
this(char[] path = null) #
char[] name() [final] #
Return a short name
char[] toString() [final] #
Return a long name
bool exists() [final] #
Does this file exist?
ulong size() [final] #
Return the file size
VfsFile create() [final] #
Create a new file instance
VfsFile create(InputStream input) [final] #
Create a new file instance and populate with stream
VfsFile copy(VfsFile source) #
Create and copy the given source
VfsFile move(VfsFile source) [final] #
Create and copy the given source, and remove the source
InputStream input() [final] #
Return the input stream. Don't forget to close it
OutputStream output() [final] #
Return the output stream. Don't forget to close it
VfsFile remove() [final] #
Remove this file
VfsFile dup() [final] #
Duplicate this entry
Time modified() [final] #
Modified time of the file