Properties

The properties is a struct containing key-value pairs of strings, which can be easily and efficiently written to and read from a file.

Constructors

this
this(string[string] valueMap)

Constructs a Properties from the given values.

this
this(string[] filenames)

Constructs a Properties by reading from each of the given files, in the order that they're provided. Note that properties in an earlier file will be overwritten by properties of the same key in later files.

Members

Functions

addAll
void addAll(Properties[] properties)

Adds all properties from the given Properties to this one, overwriting any properties with the same name.

addAll
void addAll(string[] filenames)

Adds all properties from the given files to this one.

get
string get(string key, string defaultValue)

Gets the value of a property, or returns the specified default value if the given property doesn't exist.

get
T get(string key)

Gets a property's value as a certain type. If the property does not exist, a MissingPropertyException is thrown. If the conversion could not be performed, a std.conv.ConvException is thrown.

get
T get(string key, T defaultValue)

Gets a property's value as a certain type. If the property does not exist, a default value is returned. If the conversion could not be performed, a std.conv.ConvException is thrown.

getAll
Properties getAll(string prefix)

Gets a new set of properties containing only those whose names match the given prefix.

getAll
T getAll(string prefix)

Gets a set of properties whose names match the given prefix, and uses them to populate a struct of the given type.

has
bool has(string key)

Checks if the given property exists within this set.

opBinaryRight
bool opBinaryRight(string key)

Implementation of the binary "in" operator to determine if a property is defined for this properties object.

opEquals
bool opEquals(Properties other)

Determines if this properties object is equal to the other.

opIndex
string opIndex(string key)

Gets the value of a property, or throws a missing property exception.

opIndexAssign
void opIndexAssign(string value, string key)

Assigns the given value to a property.

Variables

values
string[string] values;

The internal values of this properties struct.

Meta