Logo ROOT  
Reference Guide
RooStreamParser Class Reference

Definition at line 21 of file RooStreamParser.h.

Public Member Functions

 RooStreamParser (std::istream &is)
 Construct parser on given input stream. More...
 
 RooStreamParser (std::istream &is, const TString &errPrefix)
 Construct parser on given input stream. More...
 
virtual ~RooStreamParser ()
 Destructor. More...
 
bool atEOF ()
 
bool atEOL ()
 If true, parser is at end of line in stream. More...
 
bool convertToDouble (const TString &token, double &value)
 Convert given string to a double. Return true if the conversion fails. More...
 
bool convertToInteger (const TString &token, Int_t &value)
 Convert given string to an Int_t. More...
 
bool convertToString (const TString &token, TString &string)
 Convert given token to a string (i.e. remove eventual quotation marks) More...
 
bool expectToken (const TString &expected, bool zapOnError=false)
 Read the next token and return true if it is identical to the given 'expected' token. More...
 
TString getPunctuation () const
 
virtual TClassIsA () const
 
bool isPunctChar (char c) const
 Check if given char is considered punctuation. More...
 
bool readDouble (double &value, bool zapOnError=false)
 Read the next token and convert it to a double. More...
 
bool readInteger (Int_t &value, bool zapOnError=false)
 Read a token and convert it to an Int_t. More...
 
TString readLine ()
 Read an entire line from the stream and return as TString This method recognizes the use of '\' in the istream as line continuation token. More...
 
bool readString (TString &value, bool zapOnError=false)
 Read a string token. More...
 
TString readToken ()
 Read one token separated by any of the know punctuation characters This function recognizes and handles comment lines in the istream (those starting with '#', quoted strings ("") the content of which is not tokenized and '+-. More...
 
void setPunctuation (const TString &punct)
 Change list of characters interpreted as punctuation. More...
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void zapToEnd (bool inclContLines=false)
 Eat all characters up to and including then end of the current line. More...
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Attributes

bool _atEOF
 
bool _atEOL
 
std::istream * _is
 
TString _prefix
 
TString _punct
 

#include <RooStreamParser.h>

Constructor & Destructor Documentation

◆ RooStreamParser() [1/2]

RooStreamParser::RooStreamParser ( std::istream &  is)

Construct parser on given input stream.

Definition at line 57 of file RooStreamParser.cxx.

◆ RooStreamParser() [2/2]

RooStreamParser::RooStreamParser ( std::istream &  is,
const TString errorPrefix 
)

Construct parser on given input stream.

Use given errorPrefix to prefix any parsing error messages

Definition at line 67 of file RooStreamParser.cxx.

◆ ~RooStreamParser()

RooStreamParser::~RooStreamParser ( )
virtual

Destructor.

Definition at line 77 of file RooStreamParser.cxx.

Member Function Documentation

◆ atEOF()

bool RooStreamParser::atEOF ( )
inline

Definition at line 44 of file RooStreamParser.h.

◆ atEOL()

bool RooStreamParser::atEOL ( )

If true, parser is at end of line in stream.

Definition at line 86 of file RooStreamParser.cxx.

◆ Class()

static TClass * RooStreamParser::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * RooStreamParser::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static Version_t RooStreamParser::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 58 of file RooStreamParser.h.

◆ convertToDouble()

bool RooStreamParser::convertToDouble ( const TString token,
double value 
)

Convert given string to a double. Return true if the conversion fails.

Definition at line 427 of file RooStreamParser.cxx.

◆ convertToInteger()

bool RooStreamParser::convertToInteger ( const TString token,
Int_t value 
)

Convert given string to an Int_t.

Returns true if an error occurred in conversion

Definition at line 467 of file RooStreamParser.cxx.

◆ convertToString()

bool RooStreamParser::convertToString ( const TString token,
TString string 
)

Convert given token to a string (i.e. remove eventual quotation marks)

Definition at line 500 of file RooStreamParser.cxx.

◆ DeclFileName()

static const char * RooStreamParser::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 58 of file RooStreamParser.h.

◆ expectToken()

bool RooStreamParser::expectToken ( const TString expected,
bool  zapOnError = false 
)

Read the next token and return true if it is identical to the given 'expected' token.

Definition at line 395 of file RooStreamParser.cxx.

◆ getPunctuation()

TString RooStreamParser::getPunctuation ( ) const
inline

Definition at line 32 of file RooStreamParser.h.

◆ IsA()

virtual TClass * RooStreamParser::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 58 of file RooStreamParser.h.

◆ isPunctChar()

bool RooStreamParser::isPunctChar ( char  c) const

Check if given char is considered punctuation.

Definition at line 107 of file RooStreamParser.cxx.

◆ readDouble()

bool RooStreamParser::readDouble ( double value,
bool  zapOnError = false 
)

Read the next token and convert it to a double.

Returns true if an error occurred in reading or conversion

Definition at line 414 of file RooStreamParser.cxx.

◆ readInteger()

bool RooStreamParser::readInteger ( Int_t value,
bool  zapOnError = false 
)

Read a token and convert it to an Int_t.

Returns true if an error occurred in reading or conversion

Definition at line 454 of file RooStreamParser.cxx.

◆ readLine()

TString RooStreamParser::readLine ( )

Read an entire line from the stream and return as TString This method recognizes the use of '\' in the istream as line continuation token.

Definition at line 307 of file RooStreamParser.cxx.

◆ readString()

bool RooStreamParser::readString ( TString value,
bool  zapOnError = false 
)

Read a string token.

Returns true if an error occurred in reading or conversion. If a the read token is enclosed in quotation marks those are stripped in the returned value

Definition at line 488 of file RooStreamParser.cxx.

◆ readToken()

TString RooStreamParser::readToken ( )

Read one token separated by any of the know punctuation characters This function recognizes and handles comment lines in the istream (those starting with '#', quoted strings ("") the content of which is not tokenized and '+-.

' characters that are part of a floating point numbers and are exempt from being interpreted as a token separator in case '+-.' are defined as token separators.

Definition at line 127 of file RooStreamParser.cxx.

◆ setPunctuation()

void RooStreamParser::setPunctuation ( const TString punct)

Change list of characters interpreted as punctuation.

Definition at line 97 of file RooStreamParser.cxx.

◆ Streamer()

virtual void RooStreamParser::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void RooStreamParser::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 58 of file RooStreamParser.h.

◆ zapToEnd()

void RooStreamParser::zapToEnd ( bool  inclContLines = false)

Eat all characters up to and including then end of the current line.

If inclContLines is true, all continuation lines marked by the '\' token are zapped as well

Definition at line 359 of file RooStreamParser.cxx.

Member Data Documentation

◆ _atEOF

bool RooStreamParser::_atEOF
protected

Definition at line 53 of file RooStreamParser.h.

◆ _atEOL

bool RooStreamParser::_atEOL
protected

Definition at line 52 of file RooStreamParser.h.

◆ _is

std::istream* RooStreamParser::_is
protected

Definition at line 51 of file RooStreamParser.h.

◆ _prefix

TString RooStreamParser::_prefix
protected

Definition at line 54 of file RooStreamParser.h.

◆ _punct

TString RooStreamParser::_punct
protected

Definition at line 55 of file RooStreamParser.h.


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