Simple parser class for Marlin. More...
#include <Parser.h>
Public Member Functions | |
Parser (const std::string &fileName) | |
std::shared_ptr< StringParameters > | getParameters (const std::string §ionName) const |
Return the StringParameters defined for this section of the steering file. | |
void | setCmdLineParameters (const CommandLineParametersMap &) |
set command line parameters | |
void | parse () |
Parse the input file. | |
void | write (const std::string &fname) const |
Write down the parsed file in a new file. More... | |
Protected Member Functions | |
int | readNextValidLine (std::string &str, std::istream &stream) |
Helper method that reads the next line from a stream that is not empty or starts with a '#'. | |
Protected Attributes | |
StringParametersMap | _map {} |
StringParameters * | _current |
std::string | _fileName |
Simple parser class for Marlin.
Creates Parameter objects for all sections in a steering file defined by enclosing
.begin SectionName
.end
Parameters are defined for every line that doesn't start with #. The first string is the name of the parameter (key) the rest of the line is interpreted as the list of values separated by whitespace. Values from multiple lines starting with the same name/key are appended to the corresponding list.
|
virtual |
Write down the parsed file in a new file.
For this implementation, just copy paste the steering file
Implements marlin::IParser.