laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.

Class for parsing text files. More...

#include <LauTextFileParser.hh>

Public Member Functions

 LauTextFileParser (const char *s)
 Constructor. More...
 
 LauTextFileParser (const std::string &s)
 Constructor. More...
 
 LauTextFileParser (const TString &s)
 Constructor. More...
 
virtual ~LauTextFileParser ()
 Destructor.
 
void processFile ()
 Parse the file.
 
std::vector< std::string > getLine (UInt_t lineNo)
 Retrieve the specified line. More...
 
std::vector< std::string > getNextLine ()
 Retrieve the next line. More...
 
void resetLineNumber (UInt_t lineNo)
 Set the line number. More...
 
UInt_t getTotalNumLines () const
 Get the total number of lines that are not comments. More...
 

Private Types

typedef std::map< int, std::vector< std::string > > LineMap
 The type used to contain the parsed text.
 

Private Member Functions

 LauTextFileParser (const LauTextFileParser &rhs)
 Copy constructor (not implemented)
 
LauTextFileParseroperator= (const LauTextFileParser &rhs)
 Copy assignment operator (not implemented)
 

Private Attributes

std::string theFile_
 The name of the file.
 
LineMap lineMap_
 The parsed text.
 
UInt_t totalLines_
 The total number of lines in the file.
 
UInt_t lineNumber_
 The current line number.
 

Detailed Description

Class for parsing text files.

Class for parsing text files. Each line is split on spaces.

Definition at line 46 of file LauTextFileParser.hh.

Constructor & Destructor Documentation

◆ LauTextFileParser() [1/3]

LauTextFileParser::LauTextFileParser ( const char *  s)

Constructor.

Parameters
[in]sfilename

Definition at line 43 of file LauTextFileParser.cc.

◆ LauTextFileParser() [2/3]

LauTextFileParser::LauTextFileParser ( const std::string &  s)

Constructor.

Parameters
[in]sfilename

Definition at line 50 of file LauTextFileParser.cc.

◆ LauTextFileParser() [3/3]

LauTextFileParser::LauTextFileParser ( const TString &  s)

Constructor.

Parameters
[in]sfilename

Definition at line 57 of file LauTextFileParser.cc.

Member Function Documentation

◆ getLine()

std::vector< std::string > LauTextFileParser::getLine ( UInt_t  lineNo)

Retrieve the specified line.

Parameters
[in]lineNothe line number
Returns
the specified line

Definition at line 146 of file LauTextFileParser.cc.

◆ getNextLine()

std::vector< std::string > LauTextFileParser::getNextLine ( )

Retrieve the next line.

Returns
the next line

Definition at line 137 of file LauTextFileParser.cc.

◆ getTotalNumLines()

UInt_t LauTextFileParser::getTotalNumLines ( ) const
inline

Get the total number of lines that are not comments.

Returns
the total number of non-comment lines

Definition at line 96 of file LauTextFileParser.hh.

◆ resetLineNumber()

void LauTextFileParser::resetLineNumber ( UInt_t  lineNo)
inline

Set the line number.

Parameters
[in]lineNothe new line number

Definition at line 90 of file LauTextFileParser.hh.


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