FConfigIniStruct
UE's struct spelling inside a value: (Name="Jump",Type=Button,Keys=("A","B")). Fields split at top-level commas — parentheses nest, quotes hide commas — and keep their quotes until Unquote, so a reader can tell the text "1" from 1.
- Module
- Core
- Header
#include "Core/ConfigIni.h"- Namespace
Mowo
FromNode/ToNode carry an MDF node through it losslessly: Name= is the node's name, each property keeps its key (a list as (a,b), text always quoted), and each child type is a capitalised key holding a list of child structs — (Name="Jump",type="Button",Binding=((Name="Key",key="Space"))). Properties are lower-case and child types capitalised in every MDF config this replaces, so the case of the key is what tells them apart.
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Parse | |
bool | SplitList | The elements of "(a,b,(c,d))" at the top level; false when text is not a parenthesised list. |
std::string | Unquote | |
std::string | Quote | |
const std::string* | Find | The raw value of key, or null. |
std::string | Format | (Key=Value,...) from already-spelled values. |
std::string | FromNode | |
bool | ToNode | |
FConfigIniFile | FromDocument | A whole document as sections: each root Type "Name" is the section [Type Name] (just [Type] when unnamed), its properties are the section's keys, and each child is a +<ChildType>=<struct> line. |
void | ToDocument |
Function details
Parse
static bool Parse(const std::string& text, std::vector<std::pair<std::string, std::string>>& out)SplitList
static bool SplitList(const std::string& text, std::vector<std::string>& out)The elements of "(a,b,(c,d))" at the top level; false when text is not a parenthesised list.
Unquote
static std::string Unquote(const std::string& text, bool* quoted = nullptr)Quote
static std::string Quote(const std::string& text)Find
static const std::string* Find(const std::vector<std::pair<std::string, std::string>>& fields, const std::string& key)The raw value of key, or null.
Format
static std::string Format(const std::vector<std::pair<std::string, std::string>>& fields)(Key=Value,...) from already-spelled values.
FromNode
static std::string FromNode(const MDF::MdfNode& node)ToNode
static bool ToNode(const std::string& text, MDF::MdfNode& out)FromDocument
static FConfigIniFile FromDocument(const MDF::MdfDocument& doc)A whole document as sections: each root Type "Name" is the section [Type Name] (just [Type] when unnamed), its properties are the section's keys, and each child is a +<ChildType>=<struct> line. ToDocument rebuilds the same document, so a config whose reader walks MDF nodes reads its INI through the code it already has.
ToDocument
static void ToDocument(const FConfigIniFile& file, MDF::MdfDocument& out)