Config
- Module
- Core
- Header
#include "Core/Config.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
Config() = default | Config | |
~Config() = default | ~Config | |
Config(const Config&) = delete | Config | |
Config(Config&&) = default | Config |
Public functions
| Returns | Name | Description |
|---|---|---|
Config& | operator= | |
Config& | operator= | |
bool | Load | |
bool | Save | Also updates the stored filepath. |
bool | Save | |
bool | Parse | |
bool | Overlay | Merge another config file into this one without clearing. |
void | OverlayDocument | Overlay from a document already in memory — an INI hierarchy combined from several layer files has no single path to name. |
bool | IsLoaded | |
const std::string& | GetFilePath | |
void | SetFilePath | Records where a later Save() should land without writing anything now. |
T | GetValue | |
std::optional<T> | GetOptional | |
std::vector<T> | GetArray | |
void | SetValue | Supports dotted keys like "section.key". |
void | SetArray | |
void | SetOverlayValue | A value from a LOWER tier (the project's Config/Engine.ini under the per-user file): readable like any other, never written by Save. |
bool | IsOverlayKey | |
bool | HasKey | |
bool | RemoveKey | |
std::vector<std::string> | GetKeys | Empty section means root. |
bool | HasSection | |
MdfDocument& | GetDocument | |
const MdfDocument& | GetDocument | |
MdfNode& | GetRootNode | Creates the node if needed. |
const MdfNode* | GetRootNode |
Function details
Config
Config() = default~Config
~Config() = defaultConfig
Config(const Config&) = deleteConfig
Config(Config&&) = defaultoperator=
Config& operator=(const Config&) = deleteoperator=
Config& operator=(Config&&) = defaultLoad
bool Load(const std::string& filepath)Save
bool Save(const std::string& filepath)Also updates the stored filepath.
Save
bool Save()Parse
bool Parse(const std::string& mdfString)Overlay
bool Overlay(const std::string& filepath, bool overwriteExisting = true)Merge another config file into this one without clearing. overwriteExisting=true — the file's values win (higher tier); false — only fills keys this config lacks (lower tier).
OverlayDocument
void OverlayDocument(const MdfDocument& doc, bool overwriteExisting = true)Overlay from a document already in memory — an INI hierarchy combined from several layer files has no single path to name.
IsLoaded
bool IsLoaded() constGetFilePath
const std::string& GetFilePath() constSetFilePath
void SetFilePath(const std::string& filepath)Records where a later Save() should land without writing anything now.
GetValue
template<typename T> T GetValue(const std::string& key, const T& defaultValue = T{}) constGetOptional
template<typename T> std::optional<T> GetOptional(const std::string& key) constGetArray
template<typename T> std::vector<T> GetArray(const std::string& key) constSetValue
template<typename T> void SetValue(const std::string& key, const T& value)Supports dotted keys like "section.key". A value set here belongs to THIS config and is saved with it.
SetArray
template<typename T> void SetArray(const std::string& key, const std::vector<T>& values)SetOverlayValue
template<typename T> void SetOverlayValue(const std::string& key, const T& value)A value from a LOWER tier (the project's Config/Engine.ini under the per-user file): readable like any other, never written by Save. The user file is what Save writes, and the project tier merged into the same document used to leak into it on the next save of anything — after which the user tier shadowed the project setting and changing it in Project Settings did nothing.
IsOverlayKey
bool IsOverlayKey(const std::string& key) constHasKey
bool HasKey(const std::string& key) constRemoveKey
bool RemoveKey(const std::string& key)GetKeys
std::vector<std::string> GetKeys(const std::string& section = "") constEmpty section means root.
HasSection
bool HasSection(const std::string& section) constGetDocument
MdfDocument& GetDocument()GetDocument
const MdfDocument& GetDocument() constGetRootNode
MdfNode& GetRootNode()Creates the node if needed.
GetRootNode
const MdfNode* GetRootNode() const