ConfigEntry

- More docs
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-27 13:24:54 +02:00
parent 73028d2be8
commit 62e73d3aac
1 changed files with 23 additions and 1 deletions

View File

@ -59,9 +59,19 @@ public struct ConfigEntry
private ConfigValue value;
private ConfigType type;
// If set at all
/**
* A flag which is used to
* know if a value has been
* set at all. This helps
* with the fact that
* an entry can be constructed
* without having a value set
*/
private bool isSet = false;
/**
* Ensures a value is set
*/
private void ensureSet()
{
if(!this.isSet)
@ -70,6 +80,10 @@ public struct ConfigEntry
}
}
/**
* Marks this entry as having
* a value set
*/
private void set()
{
this.isSet = true;
@ -79,6 +93,14 @@ public struct ConfigEntry
// @disable
// private this();
/**
* Constructs a new `ConfigEntry`
* with the given value and type
*
* Params:
* value = the value itself
* type = the value's type
*/
private this(ConfigValue value, ConfigType type)
{
this.value = value;