Resource

Represents a resource on the file system.

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(string filePath)

Creates a Resource from the given filepath.

Destructor

~this
~this()

Shuts down the File if it was instantiated.

Members

Functions

exists
bool exists()

Checks if the file still exists.

getFile
File* getFile(string mode = "r")

Converts to a std.stdio.File

needsRefresh
bool needsRefresh()

Checks if the file has been modified since it was last loaded.

read
ubyte[] read()

Read the contents of the file.

readText
string readText()

Read the contents of the file.

Properties

baseFileName
string baseFileName [@property getter]

The name of the file without its extension.

directory
string directory [@property getter]

The path to the directory containing the file.

extension
string extension [@property getter]

The extensino of the file.

fileName
string fileName [@property getter]

The name of the file with its extension.

fullPath
string fullPath [@property getter]

The full path to the file.

relativePath
string relativePath [@property getter]

The relative path from the executable to the file.

Meta