Compare commits

...

3 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 9ab19a7eed Registry
- More doc
2024-04-26 23:16:02 +02:00
Tristan B. Velloza Kildaire 1d74ffc0e5 Reg
- More duocs
2024-04-26 23:12:52 +02:00
Tristan B. Velloza Kildaire e60e3c9506 Reg
- More docs
2024-04-26 23:12:06 +02:00
1 changed files with 43 additions and 9 deletions

View File

@ -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