This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Exomia.Configuration
Daniel Baetz edited this page Jun 21, 2019
·
9 revisions
A configuration base.
public abstract class Exomia.Configuration.ConfigBase
: IConfig
Constructors
Type | Name | Summary |
---|---|---|
.ctor |
ConfigBase(IConfigSource configSource, String name, String comment = ) |
ConfigBase constructor. |
Fields
Type | Name | Summary |
---|---|---|
String |
_comment | The comment. |
IConfigSource |
_configSource | The configuration source. |
String |
_name | The name. |
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. |
Dictionary<String, ValueCommentPair> |
VcPairs | Gets the vc pairs. |
Events
Type | Name | Summary |
---|---|---|
ConfigKeyEventHandler |
KeyRemoved | Occurs when Key Removed. |
ConfigKeyEventHandler |
KeySet | Occurs when Key Set. |
Methods
Type | Name | Summary |
---|---|---|
Boolean |
Contains(String key) |
checks if the config contains the given key. |
String |
ExpandValue(String value) |
ExpandValue. |
T |
Get(String key) |
get a value from the given key in the config. |
T |
GetExpanded(String key) |
get a value from the given key in the config. |
void |
OnKeyRemove(IConfig sender, String key, String value, String comment) |
called than IConfig removes a key. |
void |
OnKeySet(IConfig sender, String key, String value, String comment) |
called than IConfig set a key. |
Boolean |
Remove(String key) |
removes a given key from the config. |
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. |
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. |
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. |
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. |
Boolean |
TryRemove(String key) |
tries to removes a given key from the config. |
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. |
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. |
A configuration source base.
public abstract class Exomia.Configuration.ConfigSourceBase
: IConfigSource
Constructors
Type | Name | Summary |
---|---|---|
.ctor |
ConfigSourceBase() |
Fields
Type | Name | Summary |
---|---|---|
Dictionary<String, IConfig> |
_configs | The configs. |
Properties
Type | Name | Summary |
---|---|---|
IConfig |
Item | returns a IConfig from a given section. |
Events
Type | Name | Summary |
---|---|---|
ConfigSourceEventHandler |
Reloaded | Occurs when Reloaded. |
ConfigSourceEventHandler |
Saved | Occurs when Saved. |
Methods
Type | Name | Summary |
---|---|---|
IConfig |
Add(String section, String comment = ) |
adds a new config to the config source. |
IConfig |
CreateConfig(String section, String comment) |
creates a new IConfig. |
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 config source into current one. |
void |
OnReload() | called than IConfigSource reloaded. |
void |
OnSave() | called than IConfigSource saved. |
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. |
Interface for configuration.
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) |
get a value from the given key in the config. |
T |
GetExpanded(String key) |
get a value from the given key in the config. |
Boolean |
Remove(String key) |
removes a given key from the config. |
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. |
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) |
try to get a value from the given key in the config if the key does not exists false will be returned. |
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. |
Boolean |
TryRemove(String key) |
tries to removes a given key from the config. |
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. |
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. |
Interface for configuration source.
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 config 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. |