TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class VirtualFileSystem in Tinman.Core.IO.Files

A filesystem that maps virtual paths to real filesystem paths.

sealed class VirtualFileSystem extends FileSystem
  implements IConfigurable

Remarks

The IFile instances that are created by this class can safely be cast to VirtualFile.

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<VirtualFileSystem>
value [not-null] The configurator object.

ToConfig

Returns the configuration value that describes this object.

public method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements IConfigurable.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Public / Attributes

CanCreate

Is this object capable of creating new resources?

public virtual property CanCreate { get }
type bool
value true if this object can create new resources, false if it cannot.
inherited FileSystem.CanCreate

CanDelete

Is this object capable of deleting files?

public virtual property CanDelete { get }
type bool
value true if this object can delete resources, false if it cannot.
inherited FileSystem.CanDelete

CanOpen

Is this object capable of opening existing files?

public virtual property CanOpen { get }
type bool
value true if this object can open existing resources, false if it cannot.
inherited FileSystem.CanOpen

Directory

Gets or sets the current directory of this filesystem.

public override property Directory { get set }
type Path
value [not-null] The current directory.
implements FileSystem.Directory

Remarks:

The returned directory will always be in canonical form (see Canonical ).

Files

Returns a list of currently opened files.

public property Files { get }
type IVectorConst<VirtualFile>
value [not-null] The list of open files.

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Roots

Returns the root nodes of this filesystem.

public override property Roots { get }
type Path[]
value [not-null] The root nodes.
implements FileSystem.Roots

Public / Constructors

VirtualFileSystem

Creates a new instance of VirtualFileSystem.

public constructor VirtualFileSystem (string rootSelector, IEnumerable<VirtualPath> paths)
params rootSelector [not-empty] The root selector to use.
  paths [not-null] The virtual path mappings to use.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

DirectoryCreate

Creates the given directory.

public override method DirectoryCreate (Path directoryPath)
params directoryPath [not-null] The directory path.
implements FileSystem.DirectoryCreate

Remarks:

If the given directory already exists, the method returns silently.

The method will create all ancestor directories if necessary.

DirectoryDelete

Tries to deletes the given directory if it exists.

public override method DirectoryDelete (Path directoryPath)
type bool
params directoryPath [not-null] The path.
returns true if the directory has been deleted, false if it not.
implements FileSystem.DirectoryDelete

Remarks:

A directory can only be deleted if it is empty.

DirectoryExists

Checks if the given directory exists.

public override method DirectoryExists (Path directoryPath)
type bool
params directoryPath The directory path.
returns true if the directory exists, false if not.
implements FileSystem.DirectoryExists

DirectoryFreeSpace

Returns the amount of storage space that is available in the given directory.

public override method DirectoryFreeSpace (Path directoryPath)
type int64
params directoryPath [not-null] The directory path.
returns [>=0] The available storage space, in bytes.
overrides FileSystem.DirectoryFreeSpace

Remarks:

If the given directory does not exist, the storage space for the nearest existing ancestor directory is reported.

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

FileDelete

Permanently deletes a binary object.

public override method FileDelete (Path filePath)
type bool
params filePath [not-null] The file path.
returns true if the binary object has been deleted, false if it did not exist.
implements FileSystem.FileDelete

FileExists

Checks if a binary object exists under the given path.

public override method FileExists (Path filePath)
type bool
params filePath The path.
returns true if filePath points to an existing binary object, false if not.
implements FileSystem.FileExists

FileNew

Creates a new instance of IFile.

[OwnerReturn]
public override method FileNew (Path filePath, FileFlags flags)
type IFile
params filePath [not-null] The file path.
  flags The file flags (creation disposition and behaviour flags).
returns [not-null] The created binary object.
implements FileSystem.FileNew

Remarks:

The PathInfo property of the returned IFile will always be in canonical form (see Canonical).

ListDirectories

Lists all subdirectories in the given directory.

public override method ListDirectories (Path directoryPath, string pattern = null)
type Path[]
params directoryPath [not-null] The directory.
  pattern Optional name pattern using '?' and '*' wildcards. Defaults to null.
returns [not-null] The list of canonical directory paths. The returned list order has no particular sort order.
implements FileSystem.ListDirectories

Remarks:

The returned pathnames are absolute and fully resolved.

See also:

Path.Canonical

ListFiles

Lists all files in the given directory.

public override method ListFiles (Path directoryPath, string pattern = null)
type Path[]
params directoryPath [not-null] The directory.
  pattern Optional name pattern using '?' and '*' wildcards. Defaults to null.
returns [not-null] The list of canonical file paths. The returned list order has no particular sort order.
implements FileSystem.ListFiles

Remarks:

The returned pathnames are absolute and fully resolved.

See also:

Path.Canonical

OwnsPath

Does this filesystem own the given path?

public override method OwnsPath (Path path)
type bool
params path [not-null] The path object.
returns true if this filesystem should be used for the given path, false if not.
implements FileSystem.OwnsPath

Logging

Logger

The logger object of this class.

public static readonly field Logger
type ILogger