|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
YAML implementation of the IParser interface. More...
#include <YamlParser.h>


Public Member Functions | |
| std::shared_ptr< DBNode > | parse (const std::string &input) const override |
| Parses a YAML string into a DBNode hierarchy. | |
| void | writeToFile (const std::string &filename, const std::shared_ptr< DBNode > &root) const override |
| Writes a DBNode hierarchy to a YAML file. | |
| std::shared_ptr< DBNode > | readFromFile (const std::string &filename) const override |
| Reads and parses YAML data from a file. | |
Public Member Functions inherited from IParser | |
| virtual | ~IParser ()=default |
| Virtual destructor to allow proper cleanup via base pointer. | |
YAML implementation of the IParser interface.
YAMLParser can:
The parser is intentionally minimal and focuses on the subset of YAML needed by the project (indentation-based maps and lists).
Definition at line 39 of file YamlParser.h.
|
overridevirtual |
Parses a YAML string into a DBNode hierarchy.
| input | YAML text buffer. |
| std::runtime_error | on syntax or conversion errors. |
Implements IParser.
Definition at line 21 of file YamlParser.cpp.
|
overridevirtual |
Reads and parses YAML data from a file.
The file contents are loaded into memory and passed to parse().
| filename | Source file name. |
| std::runtime_error | if the file cannot be opened or parsing fails. |
Implements IParser.
Definition at line 209 of file YamlParser.cpp.
|
overridevirtual |
Writes a DBNode hierarchy to a YAML file.
This uses DBNode::printYAMLToStream() to serialize the tree in a readable YAML-like format.
| filename | Target file name. |
| root | Root node to serialize. |
| std::runtime_error | if the file cannot be opened or writing fails. |
Implements IParser.
Definition at line 198 of file YamlParser.cpp.