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

class FileSystem in Tinman.Core.IO.Files

abstract class FileSystem extends Disposable
  implements IFileSystem
  base of HttpFileSystem
  LocalFileSystem
  MemoryFileSystem
  VirtualFileSystem

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.
implements ICanCreateOpenDelete.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.
implements ICanCreateOpenDelete.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.
implements ICanCreateOpenDelete.CanOpen

Directory

Gets or sets the current directory of this filesystem.

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

Remarks:

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

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 abstract property Roots { get }
type Path[]
value [not-null] The root nodes.
implements IFileSystem.Roots

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 abstract method DirectoryCreate (Path directoryPath)
params directoryPath [not-null] The directory path.
implements IFileSystem.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 abstract 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 IFileSystem.DirectoryDelete

Remarks:

A directory can only be deleted if it is empty.

DirectoryExists

Checks if the given directory exists.

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

DirectoryFreeSpace

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

public virtual method DirectoryFreeSpace (Path directoryPath)
type int64
params directoryPath [not-null] The directory path.
returns [>=0] The available storage space, in bytes.
implements IFileSystem.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 abstract 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 IFileSystem.FileDelete

FileExists

Checks if a binary object exists under the given path.

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

FileNew

Creates a new instance of IFile.

[OwnerReturn]
public abstract 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 IFileSystem.FileNew

Remarks:

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

From

Returns the first FileSystem object instance that owns the given path.

public static method From (Path path)
type FileSystem
params path [not-null] The path.
returns The FileSystem or null.

ListDirectories

Lists all subdirectories in the given directory.

public abstract 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 IFileSystem.ListDirectories

Remarks:

The returned pathnames are absolute and fully resolved.

See also:

Path.Canonical

ListFiles

Lists all files in the given directory.

public abstract 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 IFileSystem.ListFiles

Remarks:

The returned pathnames are absolute and fully resolved.

See also:

Path.Canonical

OwnsPath

Does this filesystem own the given path?

public abstract 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 IFileSystem.OwnsPath

Protected / Constructors

FileSystem

protected constructor FileSystem ()

Protected / Methods

DisposeManaged

Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.

protected override method DisposeManaged ()
overrides Disposable.DisposeManaged

Remarks:

This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.

Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.

The DisposeManaged method is called before the DisposeUnmanaged method.

DisposeUnmanaged

Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.

protected virtual method DisposeUnmanaged ()
inherited Disposable.DisposeUnmanaged

Remarks:

Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.

The DisposeUnmanaged method is called after the DisposeManaged method.