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

class FileFormat in Tinman.Terrain.Util

Abstract base class for IFileFormat implementations that represent a concrete file format.

abstract class FileFormat implements IFileFormat
  base of ImageFormat
  ModelFormat
  ShapeFormat

Public / Attributes

Description

Long description of this file format.

public virtual property Description { get }
type string
value [not-null] The description string.
implements IFileFormat.Description

Name

The file format name.

public property Name { get }
type string
value [not-null] The file format name.
implements IFileFormat.Name

Next

Returns the next file format.

[ThreadSafe]
public property Next { get }
type IFileFormat
value The next file format or null.
implements IFileFormat.Next

Remarks:

The first file format can be obtained from implementing classes. This property can be used to cycle all available file formats of the same type.

Type

The type of this file format (e.g. images, shapes, 3D models).

public property Type { get }
type string
value [not-null] The human-readable type name.
implements IFileFormat.Type

Public / Methods

CanRead

Can this file format object be used to read the given path?

public virtual method CanRead (string suffix, bool directory = false)
type bool
params suffix [not-null] The lower-case pathname suffix (without '.'). Will be empty if the path does not have a pathname suffix.
  directory Does the path refer to a directory (true) or to a file (false)? Defaults to false.
returns true if this file format can be used, false if not.
implements IFileFormat.CanRead

CanReadFind

Returns the first file format in the chain (see IFileFormat) that can read the given path.

public method CanReadFind (string suffix, bool directory = false)
type IFileFormat
params suffix [not-null] The lower-case pathname suffix (without '.'). Will be empty if the path does not have a pathname suffix.
  directory Does the path refer to a directory (true) or to a file (false)? Defaults to false.
returns The found file format or null.
implements IFileFormat.CanReadFind

CanWrite

Can this file format object be used to write the given path?

public virtual method CanWrite (string suffix)
type bool
params suffix [not-null] The lower-case pathname suffix (without '.'). Will be empty if the path does not have a pathname suffix.
returns true if this file format can be used, false if not.
implements IFileFormat.CanWrite

PleaseIncludeInBinaryThanks

This is a no-op method that forces the compiler / linker to include this type in the resulting binary.

public virtual method PleaseIncludeInBinaryThanks ()
implements IPleaseIncludeInBinaryThanks.PleaseIncludeInBinaryThanks

Remarks:

Calling this stub method makes sure that all lazy constructor calls have been made.

To initialize everything, an application needs to call this method on its root module(s) (see TinmanModule), followed by a call to PleaseIncludeInBinaryThanksAll.

ToString

[Pure]
public override method ToString ()
type string

Protected / Attributes

IsRegistered

Has this file format been registered?

protected property IsRegistered { get }
type bool
value true if this file format has been registered, false if not.

See also:

Register

Protected / Constructors

FileFormat

Creates a new instance of FileFormat.

protected constructor FileFormat (string name, string description, string type, bool isAny = false)
params name [not-empty] Value for Name
  description [not-empty] Value for Description
  type [not-empty] Value for Type
  isAny Is this an automatic file format?

Protected / Methods

NameFind

Finds the IFileFormat that has the given name.

protected method NameFind (string name)
type IFileFormat
params name [not-empty] The file format name.
returns The found file format or null.

NotSupported

protected static method NotSupported (string source, Path path, string name, bool directory, string suffix)
type IOException
params source
  path
  name
  directory
  suffix

Register

Appends this file format to the chain of the given file format.

[ThreadSafe]
protected method Register (FileFormat any)
params any [not-null] The file format chain to append to.

ThrowIfNotRegistered

protected method ThrowIfNotRegistered ()