THaTextvars Generic string substitution facility Contains a dictionary of text variable names and associated values. Used for preprocessing of analyzer input files: Variable references of the form ${name} in input files are replaced by their value. For example, ${spectro}.s1.adc ==> R.s1.adc The analyzer makes one instance of this class available via the global gHaTextvars for easy access in scripts. This code runs at initialization time and thus is not time-critical.
THaTextvars() | |
THaTextvars(const THaTextvars&) | |
virtual | ~THaTextvars() |
Int_t | Add(const string& name, const string& value) |
Int_t | AddVerbatim(const string& name, const string& value) |
static TClass* | Class() |
void | Clear() |
const char* | Get(const string& name, Int_t idx = 0) const |
vector<std::string> | GetArray(const string& name) |
UInt_t | GetArray(const string& name, vector<std::string>& array) |
UInt_t | GetNvalues(const string& name) const |
virtual TClass* | IsA() const |
THaTextvars& | operator=(const THaTextvars&) |
void | Print(Option_t* opt = "") const |
void | Remove(const string& name) |
Int_t | Set(const string& name, const string& value) |
virtual void | ShowMembers(TMemberInspector&) |
UInt_t | Size() const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
Int_t | Substitute(string& line) const |
Int_t | Substitute(vector<std::string>& lines) const |
Int_t | Substitute(vector<std::string>& lines, bool do_multi) const |
Get the i-th value of the text variable with the given name. Returns either the value or NULL if not found.
Get the array of values for the text variable with the given name. Returns number of values found (size of array), or zero if not found.
Get the number of values for the text variable with the given name.
Substitute text variables in a single string. If any multi-valued variables are encountered, treat it as an error
Substitute text variables in the given array of strings. Supports multi-valued text variables, where each instance is separated by commas; e.g. arm = "L,R". Text Variables have the form ${name} Returns 0 if success, 1 on error (name not found)