Repository navigation
Exomia.Configuration
A configuration base.
public abstract class Exomia.Configuration.ConfigBase
: IConfig.ctor ConfigBase(IConfigSource configSource, String name, String comment = )
ConfigBase constructor.
-
configSource- The configuration source. -
name- The name. -
comment- (Optional) new comment.
Boolean Contains(String key)
checks if the config contains the given key.
-
key- Key.
T GetExpanded(String key)
get a value from the given key in the config.
-
key- key.
void OnKeyRemove(IConfig sender, String key, String value, String comment)
called than IConfig removes a key.
-
sender- sender. -
key- old key. -
value- old value. -
comment- old comment.
void OnKeySet(IConfig sender, String key, String value, String comment)
called than IConfig set a key.
-
sender- IConfig. -
key- new key. -
value- new value. -
comment- new comment.
void Set(String key, T value, String comment = )
set a key - value pair in the config if a key already exists it will be overwritten.
-
key- key. -
value- value. -
comment- (Optional) 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.
-
key- key. -
format- format. -
comment- comment. -
keys- keys.
String ToString()Boolean TryGet(String key, T& outValue)
try to get a value from the given key in the config if the key does not exists false will be returned.
-
key- key. -
outValue- [out] out value.
Boolean TryGetExpanded(String key, T& outValue)
try to get a value from the given key in the config if the key does not exists false will be returned.
-
key- key. -
outValue- [out] out value.
Boolean TryRemove(String key)
tries to removes a given key from the config.
-
key- key.
Boolean TrySet(String key, T value, String comment = )
try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.
-
key- key. -
value- value. -
comment- (Optional) 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 all ready exists nothing happen and false will be returned.
-
key- key. -
format- format. -
comment- comment. -
keys- keys.
A configuration source base.
public abstract class Exomia.Configuration.ConfigSourceBase
: IConfigSource.ctor ConfigSourceBase()IConfig Add(String section, String comment = )
adds a new config to the config source.
-
section- section. -
comment- (Optional) comment.
IConfig CreateConfig(String section, String comment)
creates a new IConfig.
-
section- section. -
comment- comment.
IConfig Get(String section)
returns a IConfig from a given section.
-
section- section.
void Merge(IConfigSource source)
merge all configs from the given config source into current one.
-
source- 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.
-
section- section. -
config- [out] out config.
Interface for configuration.
public interface Exomia.Configuration.IConfigBoolean Contains(String key)
checks if the config contains the given key.
-
key- Key.
T GetExpanded(String key)
get a value from the given key in the config.
-
key- key.
void Set(String key, T value, String comment = )
set a key - value pair in the config if a key already exists it will be overwritten.
-
key- key. -
value- value. -
comment- (Optional) 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.
-
key- key. -
format- format. -
comment- comment. -
keys- keys.
Boolean TryGet(String key, T& outValue)
try to get a value from the given key in the config if the key does not exists false will be returned.
-
key- key. -
outValue- [out] out value.
Boolean TryGetExpanded(String key, T& outValue)
try to get a value from the given key in the config if the key does not exists false will be returned.
-
key- key. -
outValue- [out] out value.
Boolean TryRemove(String key)
tries to removes a given key from the config.
-
key- key.
Boolean TrySet(String key, T value, String comment = )
try to set a new key - value pair in the config if a key all ready exists nothing happen and false will be returned.
-
key- key. -
value- value. -
comment- (Optional) 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 all ready exists nothing happen and false will be returned.
-
key- key. -
format- format. -
comment- comment. -
keys- keys.
Interface for configuration source.
public interface Exomia.Configuration.IConfigSourceIConfig Add(String section, String comment = )
adds a new config to the config source.
-
section- section. -
comment- (Optional) comment.
IConfig Get(String section)
returns a IConfig from a given section.
-
section- section.
void Merge(IConfigSource source)
merge all configs from the given config source into current one.
-
source- 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.
-
section- section. -
config- [out] out config.