KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVUserAnalysisOptionList.h
Go to the documentation of this file.
1 #ifndef __KVUSERANALYSISOPTIONLIST_H
2 #define __KVUSERANALYSISOPTIONLIST_H
3 
4 #include "KVBase.h"
5 #include "KVNameValueList.h"
6 
19 
20 public:
21  void SetOpt(const Char_t* option, const Char_t* value)
22  {
24  KVString tmp(value);
25  fOptionList.SetValue(option, tmp);
26  }
27  Bool_t IsOptGiven(const Char_t* opt)
28  {
30 
31  return fOptionList.HasParameter(opt);
32  }
33  TString GetOpt(const Char_t* opt) const
34  {
38 
39  return fOptionList.GetTStringValue(opt);
40  }
41  void UnsetOpt(const Char_t* opt)
42  {
44 
46  }
47  void ParseOptions(const KVString& optlist)
48  {
52 
53  fOptionList.Clear(); // clear list
54  optlist.Begin(",");
55  while (!optlist.End()) {
56 
57  KVString opt = optlist.Next();
58  opt.Begin("=");
59  KVString param = opt.Next();
60  KVString val = opt.Next();
61  while (!opt.End()) {
62  val += "=";
63  val += opt.Next();
64  }
65 
66  SetOpt(param.Data(), val.Data());
67  }
69  }
70 
71  ClassDef(KVUserAnalysisOptionList, 1) //Handle list of options and input parameters for user analyis
72 };
73 
74 #endif
char Char_t
bool Bool_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:141
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
virtual void Print(Option_t *opt="") const
void SetValue(const Char_t *name, value_type value)
void RemoveParameter(const Char_t *name)
virtual void Clear(Option_t *opt="")
Bool_t HasParameter(const Char_t *name) const
TString GetTStringValue(const Char_t *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
Handle list of options and input parameters for user analyis.
void SetOpt(const Char_t *option, const Char_t *value)
TString GetOpt(const Char_t *opt) const
void ParseOptions(const KVString &optlist)
Bool_t IsOptGiven(const Char_t *opt)
void UnsetOpt(const Char_t *opt)
const char * Data() const