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 Jul 7, 2018 · 9 revisions

ConfigBase

public abstract class Exomia.Configuration.ConfigBase
    : IConfig

Properties

Type Name Summary
String Comment
IConfigSource ConfigSource
String Item
IEnumerable<String> Keys
String Name

Events

Type Name Summary
ConfigKeyEventHandler KeyRemoved
ConfigKeyEventHandler KeySet

Methods

Type Name Summary
Boolean Contains(String key)
T Get(String key)
T GetExpanded(String key)
Boolean Remove(String key)
void Set(String key, T value, String comment = )
void SetExpanded(String key, String format, String comment, String[] keys)
String ToString() shows the IConfig info format: [name] ;comment
Boolean TryGet(String key, T& outValue)
Boolean TryGetExpanded(String key, T& outValue)
Boolean TryRemove(String key)
Boolean TrySet(String key, T value, String comment = )
Boolean TrySetExpanded(String key, String format, String comment, String[] keys)

ConfigSourceBase

public abstract class Exomia.Configuration.ConfigSourceBase
    : IConfigSource

Properties

Type Name Summary
IConfig Item

Events

Type Name Summary
ConfigSourceEventHandler Reloaded
ConfigSourceEventHandler Saved

Methods

Type Name Summary
IConfig Add(String section, String comment = )
IConfig Get(String section)
IEnumerable<IConfig> GetConfigs()
void Merge(IConfigSource source)
void Reload()
void Save()
Boolean TryGet(String section, IConfig& config)

IConfig

IConfig interface

public interface Exomia.Configuration.IConfig

Properties

Type Name Summary
String Comment return the comment of the config section
IConfigSource ConfigSource return the IConfigSource parent
String Item get or set a value with the key in the config
IEnumerable<String> Keys get all keys in the config
String Name return the name of the config section

Events

Type Name Summary
ConfigKeyEventHandler KeyRemoved called than the IConfig remove a key
ConfigKeyEventHandler KeySet called than the IConfig set a key

Methods

Type Name Summary
Boolean Contains(String key) checks if the config contains the given key
T Get(String key)
T GetExpanded(String key)
Boolean Remove(String key) removes a given key from the config
void Set(String key, T value, String comment = )
void SetExpanded(String key, String format, String comment, String[] keys) set a key - value pair in the config if a key already exists it will be overwritten
Boolean TryGet(String key, T& outValue)
Boolean TryGetExpanded(String key, T& outValue)
Boolean TryRemove(String key) trys to removes a given key from the config
Boolean TrySet(String key, T value, String comment = )
Boolean TrySetExpanded(String key, String format, String comment, String[] keys) try to set a new key - value pair in the config if a key allready exists nothing happen and false will be returned

IConfigSource

IConfigSource interface

public interface Exomia.Configuration.IConfigSource

Properties

Type Name Summary
IConfig Item returns a IConfig from a given section

Events

Type Name Summary
ConfigSourceEventHandler Reloaded called than the IConfigSource is reloaded
ConfigSourceEventHandler Saved called than the IConfigSource is saved

Methods

Type Name Summary
IConfig Add(String section, String comment = ) adds a new config to the config source
IConfig Get(String section) returns a IConfig from a given section
IEnumerable<IConfig> GetConfigs() gets all configs in the config source
void Merge(IConfigSource source) merge all configs from the given cofig source into current one
void Reload() reloads the config source Merged config sources will be lost
void Save() saves the current config source
Boolean TryGet(String section, IConfig& config) try to get a config from the given section in the config source if the section does not exists false will be returned