mirror of https://github.com/deavmi/niknaks
Compare commits
3 Commits
e9cb212194
...
9ab19a7eed
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | 9ab19a7eed | |
Tristan B. Velloza Kildaire | 1d74ffc0e5 | |
Tristan B. Velloza Kildaire | e60e3c9506 |
|
@ -344,50 +344,84 @@ public struct Registry
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new entry and adds it
|
||||
*
|
||||
* An exception is thrown if an entry
|
||||
* at that key exists and the policy
|
||||
* for overwriting is to deny
|
||||
*
|
||||
* Params:
|
||||
* name = the key
|
||||
* entry = the configuration entry
|
||||
*/
|
||||
public void newEntry(string name, ConfigEntry entry)
|
||||
{
|
||||
newEntry(name, entry, this.allowOverwriteEntry, true);
|
||||
}
|
||||
|
||||
// TOD: Add on-the-spot ConfigEntry creastion
|
||||
|
||||
/**
|
||||
* See_Also: `newEntry(name, ConfigEntry)`
|
||||
*/
|
||||
public void newEntry(string name, int numeric)
|
||||
{
|
||||
newEntry(name, ConfigEntry.ofNumeric(numeric));
|
||||
}
|
||||
|
||||
/**
|
||||
* See_Also: `newEntry(name, ConfigEntry)`
|
||||
*/
|
||||
public void newEntry(string name, string text)
|
||||
{
|
||||
newEntry(name, ConfigEntry.ofText(text));
|
||||
}
|
||||
|
||||
/**
|
||||
* See_Also: `newEntry(name, ConfigEntry)`
|
||||
*/
|
||||
public void newEntry(string name, bool flag)
|
||||
{
|
||||
newEntry(name, ConfigEntry.ofFlag(flag));
|
||||
}
|
||||
|
||||
/**
|
||||
* See_Also: `newEntry(name, ConfigEntry)`
|
||||
*/
|
||||
public void newEntry(string name, string[] array)
|
||||
{
|
||||
newEntry(name, ConfigEntry.ofArray(array));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the entry at the given name
|
||||
* to the provided entry
|
||||
*
|
||||
* This will throw an exception if
|
||||
* the entry trying to be set does
|
||||
* not yet exist.
|
||||
*
|
||||
* Overwriting will only be allowed
|
||||
* if the policy allows it.
|
||||
*
|
||||
* Params:
|
||||
* name = the key
|
||||
* entry = the configuration
|
||||
* entry
|
||||
*/
|
||||
public void setEntry(string name, ConfigEntry entry)
|
||||
{
|
||||
newEntry(name, entry, this.allowOverwriteEntry, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ALlows overwriting ALWAYS
|
||||
// or should it NOT?
|
||||
|
||||
/**
|
||||
* Assigns the provided configuration
|
||||
* entry to the provided name
|
||||
*
|
||||
* Take note that using this method
|
||||
* will both create the entry if it
|
||||
* does not yet exist
|
||||
* will create the entry if it does
|
||||
* not yet exist.
|
||||
*
|
||||
* It will also ALWAYS allow overwriting.
|
||||
*
|
||||
* Params:
|
||||
* entry = the entry to add
|
||||
|
|
Loading…
Reference in New Issue