laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
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. More...
 
void processFile ()
 Parse the file. More...
 
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. More...
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Class for parsing text files.

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

Definition at line 32 of file LauTextFileParser.hh.

Member Typedef Documentation

typedef std::map<int, std::vector<std::string> > LauTextFileParser::LineMap
private

The type used to contain the parsed text.

Definition at line 94 of file LauTextFileParser.hh.

Constructor & Destructor Documentation

LauTextFileParser::LauTextFileParser ( const char *  s)

Constructor.

Parameters
[in]sfilename

Definition at line 28 of file LauTextFileParser.cc.

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

Constructor.

Parameters
[in]sfilename

Definition at line 35 of file LauTextFileParser.cc.

LauTextFileParser::LauTextFileParser ( const TString &  s)

Constructor.

Parameters
[in]sfilename

Definition at line 42 of file LauTextFileParser.cc.

LauTextFileParser::~LauTextFileParser ( )
virtual

Destructor.

Definition at line 49 of file LauTextFileParser.cc.

LauTextFileParser::LauTextFileParser ( const LauTextFileParser rhs)
private

Copy constructor (not implemented)

Member Function Documentation

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 127 of file LauTextFileParser.cc.

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

Retrieve the next line.

Returns
the next line

Definition at line 118 of file LauTextFileParser.cc.

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 82 of file LauTextFileParser.hh.

LauTextFileParser& LauTextFileParser::operator= ( const LauTextFileParser rhs)
private

Copy assignment operator (not implemented)

void LauTextFileParser::processFile ( )

Parse the file.

Definition at line 59 of file LauTextFileParser.cc.

void LauTextFileParser::resetLineNumber ( UInt_t  lineNo)
inline

Set the line number.

Parameters
[in]lineNothe new line number

Definition at line 76 of file LauTextFileParser.hh.

Member Data Documentation

LineMap LauTextFileParser::lineMap_
private

The parsed text.

Definition at line 100 of file LauTextFileParser.hh.

UInt_t LauTextFileParser::lineNumber_
private

The current line number.

Definition at line 106 of file LauTextFileParser.hh.

std::string LauTextFileParser::theFile_
private

The name of the file.

Definition at line 97 of file LauTextFileParser.hh.

UInt_t LauTextFileParser::totalLines_
private

The total number of lines in the file.

Definition at line 103 of file LauTextFileParser.hh.


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