laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
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 46 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 108 of file LauTextFileParser.hh.

Constructor & Destructor Documentation

LauTextFileParser::LauTextFileParser ( const char *  s)

Constructor.

Parameters
[in]sfilename

Definition at line 42 of file LauTextFileParser.cc.

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

Constructor.

Parameters
[in]sfilename

Definition at line 49 of file LauTextFileParser.cc.

LauTextFileParser::LauTextFileParser ( const TString &  s)

Constructor.

Parameters
[in]sfilename

Definition at line 56 of file LauTextFileParser.cc.

LauTextFileParser::~LauTextFileParser ( )
virtual

Destructor.

Definition at line 63 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 141 of file LauTextFileParser.cc.

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

Retrieve the next line.

Returns
the next line

Definition at line 132 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 96 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 73 of file LauTextFileParser.cc.

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.

Member Data Documentation

LineMap LauTextFileParser::lineMap_
private

The parsed text.

Definition at line 114 of file LauTextFileParser.hh.

UInt_t LauTextFileParser::lineNumber_
private

The current line number.

Definition at line 120 of file LauTextFileParser.hh.

std::string LauTextFileParser::theFile_
private

The name of the file.

Definition at line 111 of file LauTextFileParser.hh.

UInt_t LauTextFileParser::totalLines_
private

The total number of lines in the file.

Definition at line 117 of file LauTextFileParser.hh.


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