Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Exomia.Configuration

Daniel Baetz edited this page Jun 21, 2019 · 9 revisions

ConfigBase

A configuration base.

public abstract class Exomia.Configuration.ConfigBase
    : IConfig

Constructors

.ctor .ctor(IConfigSource configSource, String name, String comment = )

Summary:

ConfigBase constructor.

Parameter:

  • configSource - The configuration source.
  • name - The name.
  • comment - (Optional) new comment.


Fields

String _comment

Summary:

The comment.


IConfigSource _configSource

Summary:

The configuration source.


String _name

Summary:

The name.



Properties

String Comment

Summary:

return the comment of the config section.


IConfigSource ConfigSource

Summary:

return the IConfigSource parent.


String Item

Summary:

get or set a value with the key in the config.

Parameter:

  • key - key.

IEnumerable Keys

Summary:

get all keys in the config.


String Name

Summary:

return the name of the config section.


Dictionary VcPairs

Summary:

Gets the vc pairs.



Events

ConfigKeyEventHandler KeyRemoved

Summary:

Occurs when Key Removed.


ConfigKeyEventHandler KeySet

Summary:

Occurs when Key Set.



Methods

Boolean Contains(String key)

Summary:

checks if the config contains the given key.

Parameter:

  • key - Key.

String ExpandValue(String value)

Summary:

ExpandValue.

Parameter:

  • value - new value.

T Get(String key)

Summary:

get a value from the given key in the config.

Parameter:

  • key - key.

T GetExpanded(String key)

Summary:

get a value from the given key in the config.

Parameter:

  • key - key.

void OnKeyRemove(IConfig sender, String key, String value, String comment)

Summary:

called than IConfig removes a key.

Parameter:

  • sender - sender.
  • key - old key.
  • value - old value.
  • comment - old comment.

void OnKeySet(IConfig sender, String key, String value, String comment)

Summary:

called than IConfig set a key.

Parameter:

  • sender - IConfig.
  • key - new key.
  • value - new value.
  • comment - new comment.

Boolean Remove(String key)

Summary:

removes a given key from the config.

Parameter:

  • key - key.

void Set(String key, T value, String comment = )

Summary:

set a key - value pair in the config if a key already exists it will be overwritten.

Parameter:

  • key - key.
  • value - value.
  • comment - (Optional) comment.

void SetExpanded(String key, String format, String comment, String[] keys)

Summary:

set a key - value pair in the config if a key already exists it will be overwritten.

Parameter:

  • key - key.
  • format - format.
  • comment - comment.
  • keys - keys.

    String ToString()
Boolean TryGet(String key, T& outValue)

Summary:

try to get a value from the given key in the config if the key does not exists false will be returned.

Parameter:

  • key - key.
  • outValue - [out] out value.

Boolean TryGetExpanded(String key, T& outValue)

Summary:

try to get a value from the given key in the config if the key does not exists false will be returned.

Parameter:

  • key - key.
  • outValue - [out] out value.

Boolean TryRemove(String key)

Summary:

tries to removes a given key from the config.

Parameter:

  • key - key.

Boolean TrySet(String key, T value, String comment = )

Summary:

try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.

Parameter:

  • key - key.
  • value - value.
  • comment - (Optional) comment.

Boolean TrySetExpanded(String key, String format, String comment, String[] keys)

Summary:

try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.

Parameter:

  • key - key.
  • format - format.
  • comment - comment.
  • keys - keys.


ConfigSourceBase

A configuration source base.

public abstract class Exomia.Configuration.ConfigSourceBase
    : IConfigSource

Constructors

    .ctor .ctor()


Fields

Dictionary _configs

Summary:

The configs.



Properties

IConfig Item

Summary:

returns a IConfig from a given section.

Parameter:

  • section - section.


Events

ConfigSourceEventHandler Reloaded

Summary:

Occurs when Reloaded.


ConfigSourceEventHandler Saved

Summary:

Occurs when Saved.



Methods

IConfig Add(String section, String comment = )

Summary:

adds a new config to the config source.

Parameter:

  • section - section.
  • comment - (Optional) comment.

IConfig CreateConfig(String section, String comment)

Summary:

creates a new IConfig.

Parameter:

  • section - section.
  • comment - comment.

IConfig Get(String section)

Summary:

returns a IConfig from a given section.

Parameter:

  • section - section.

IEnumerable GetConfigs()

Summary:

gets all configs in the config source.


void Merge(IConfigSource source)

Summary:

merge all configs from the given config source into current one.

Parameter:

  • source - Config source.

void OnReload()

Summary:

called than IConfigSource reloaded.


void OnSave()

Summary:

called than IConfigSource saved.


void Reload()

Summary:

reloads the config source Merged config sources will be lost.


void Save()

Summary:

saves the current config source.


Boolean TryGet(String section, IConfig& config)

Summary:

try to get a config from the given section in the config source if the section does not exists false will be returned.

Parameter:

  • section - section.
  • config - [out] out config.


IConfig

Interface for configuration.

public interface Exomia.Configuration.IConfig

Properties

String Comment

Summary:

return the comment of the config section.


IConfigSource ConfigSource

Summary:

return the IConfigSource parent.


String Item

Summary:

get or set a value with the key in the config.

Parameter:

  • key - key.

IEnumerable Keys

Summary:

get all keys in the config.


String Name

Summary:

return the name of the config section.



Events

ConfigKeyEventHandler KeyRemoved

Summary:

called than the IConfig remove a key.


ConfigKeyEventHandler KeySet

Summary:

called than the IConfig set a key.



Methods

Boolean Contains(String key)

Summary:

checks if the config contains the given key.

Parameter:

  • key - Key.

T Get(String key)

Summary:

get a value from the given key in the config.

Parameter:

  • key - key.

T GetExpanded(String key)

Summary:

get a value from the given key in the config.

Parameter:

  • key - key.

Boolean Remove(String key)

Summary:

removes a given key from the config.

Parameter:

  • key - key.

void Set(String key, T value, String comment = )

Summary:

set a key - value pair in the config if a key already exists it will be overwritten.

Parameter:

  • key - key.
  • value - value.
  • comment - (Optional) comment.

void SetExpanded(String key, String format, String comment, String[] keys)

Summary:

set a key - value pair in the config if a key already exists it will be overwritten.

Parameter:

  • key - key.
  • format - format.
  • comment - comment.
  • keys - keys.

Boolean TryGet(String key, T& outValue)

Summary:

try to get a value from the given key in the config if the key does not exists false will be returned.

Parameter:

  • key - key.
  • outValue - [out] out value.

Boolean TryGetExpanded(String key, T& outValue)

Summary:

try to get a value from the given key in the config if the key does not exists false will be returned.

Parameter:

  • key - key.
  • outValue - [out] out value.

Boolean TryRemove(String key)

Summary:

tries to removes a given key from the config.

Parameter:

  • key - key.

Boolean TrySet(String key, T value, String comment = )

Summary:

try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.

Parameter:

  • key - key.
  • value - value.
  • comment - (Optional) comment.

Boolean TrySetExpanded(String key, String format, String comment, String[] keys)

Summary:

try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.

Parameter:

  • key - key.
  • format - format.
  • comment - comment.
  • keys - keys.


IConfigSource

Interface for configuration source.

public interface Exomia.Configuration.IConfigSource

Properties

IConfig Item

Summary:

returns a IConfig from a given section.

Parameter:

  • section - section.


Events

ConfigSourceEventHandler Reloaded

Summary:

called than the IConfigSource is reloaded.


ConfigSourceEventHandler Saved

Summary:

called than the IConfigSource is saved.



Methods

IConfig Add(String section, String comment = )

Summary:

adds a new config to the config source.

Parameter:

  • section - section.
  • comment - (Optional) comment.

IConfig Get(String section)

Summary:

returns a IConfig from a given section.

Parameter:

  • section - section.

IEnumerable GetConfigs()

Summary:

gets all configs in the config source.


void Merge(IConfigSource source)

Summary:

merge all configs from the given config source into current one.

Parameter:

  • source - Config source.

void Reload()

Summary:

reloads the config source Merged config sources will be lost.


void Save()

Summary:

saves the current config source.


Boolean TryGet(String section, IConfig& config)

Summary:

try to get a config from the given section in the config source if the section does not exists false will be returned.

Parameter:

  • section - section.
  • config - [out] out config.