ROOT logo
Podd » SRC » THaPrintOption

class THaPrintOption


 THaPrintOption

 Utility class to deal with print option strings. Supports blank- and
 comma-separated lists of options and/or numerical arguments that are
 contained in a single option string.


Function Members (Methods)

public:
THaPrintOption()
THaPrintOption(const char* string)
THaPrintOption(const THaPrintOption& opt)
virtual~THaPrintOption()
static TClass*Class()
const char*Data() const
Int_tGetNOptions() const
const char*GetOption(Int_t i = 0) const
Int_tGetValue(Int_t i = 0) const
virtual TClass*IsA() const
Bool_tIsLine() const
const char*operator const char*() const
const char*operator()(Int_t i) const
THaPrintOption&operator=(const THaPrintOption& rhs)
THaPrintOption&operator=(const char* rhs)
const char*operator[](Int_t i) const
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
protected:
virtual voidParse()

Data Members

protected:
char*fEmptyPointer to \0, returned by GetOption() if error
Int_tfNTokensNumber of tokens
Int_t*fParamArray of the parameter values in the string
Bool_tfParsedIndicator whether string has been parsed
char*fStringPointer to local copy of string
char*fTokenStrCopy of string parsed by strtok()
char**fTokensArray of pointers to the tokens in the string

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

THaPrintOption()
 Default constructor
THaPrintOption(const char* string)
 Normal constructor
THaPrintOption(const THaPrintOption& opt)
 Copy constructor
THaPrintOption& operator=(const THaPrintOption& rhs)
 Assignment operator
THaPrintOption& operator=(const char* rhs)
 Initialize object with a string
~THaPrintOption()
 Destructor
void Parse()
 Parse the string and put the results in the internal arrays.
 This function should never generate an error since the input
 cannot be invalid.
const char* GetOption(Int_t i = 0) const
 Get i-th token from string. Tokens are delimited by blanks or commas.
Int_t GetValue(Int_t i = 0) const
 Get integer value of the i-th token from string.
 Example:

 With "OPT,10,20,30" or "OPT 10 20 30", GetValue(2) returns 20.

Bool_t IsLine() const
 True if "opt" is a request for printing on a single line
Int_t GetNOptions() const
{ return fNTokens; }
const char* Data() const
{ return fString; }
operator const char*() const
{ return Data(); }
const char* operator[](Int_t i) const
{ return GetOption(i); }
const char* operator()(Int_t i) const
{ return GetOption(i); }