Marlin  1.17.1
 All Classes Namespaces Functions Variables Enumerations Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
marlin::Parser Class Reference

Simple parser class for Marlin. More...

#include <Parser.h>

Inheritance diagram for marlin::Parser:
marlin::IParser

Public Member Functions

 Parser (const std::string &fileName)
 
std::shared_ptr< StringParametersgetParameters (const std::string &sectionName) 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
 

Detailed Description

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.

Author
F. Gaede, DESY
Version
Id:
Parser.h,v 1.3 2005-10-11 12:56:28 gaede Exp

Member Function Documentation

void marlin::Parser::write ( const std::string &  fname) const
virtual

Write down the parsed file in a new file.

For this implementation, just copy paste the steering file

Implements marlin::IParser.


The documentation for this class was generated from the following files: