Common Analysis Framework » QFRAMEWORK » TQTaggable

class TQTaggable


 TQTaggable:

 The TQTaggable class represents a set of tags and introduces a methods to read and write
 tags from and to it. A tag is a key-value-pair, where the key is a unique string and the
 value might be a string, a bool, an integer or a double.

 Tags are set using either of the methods:

 - TQTaggable::setTagString("<key>", "<value>")
 - TQTaggable::setTagInteger("<key>", <value>)
 - TQTaggable::setTagDouble("<key>", <value>)
 - TQTaggable::setTagBool("<key>", <value>)

 To retrieve the value of a tag one can use

 - TQTaggable::getTagStringDefault("<key>", "<default>")
 - TQTaggable::getTagIntegerDefault("<key>", <default>)
 - TQTaggable::getTagDoubleDefault("<key>", <default>)
 - TQTaggable::getTagBoolDefault("<key>", <default>)

 where the default value <default> is used if the tag is not present or

 - TQTaggable::getTagString("<key>", <value>)
 - TQTaggable::getTagInteger("<key>", <value>)
 - TQTaggable::getTagDouble("<key>", <value>)
 - TQTaggable::getTagBool("<key>", <value>)

 where <value> is a variable set to the value of the tag if it is present (return value of
 corresponding function indicates if tag is present). In each case data types are converted
 if necessary and possible.

 The TQTaggable class is prepared to allow for an hierarchical tree-like structure of
 instances of TQTaggable (if implemented by a descendant class).

 Some special symbols allow to modify the way in which tags are retrieved:
 "~tag" search for the first occurence of tag 'tag' upwards the tree
 "tag~" search for the first occurence of tag 'tag' downwards

 Some special symbols allow to modify the way in which tags are set:
 "tag?" only set the tag if it does not exist yet, i.e. don't overwrite

 Renaming/removing tags can be done using

 - TQTaggable::removeTag(...) remove one tag

 - TQTaggable::clearTags() remove all tags

 - TQTaggable::renameTag(...) rename one tag

 - TQTaggable::renameTags(...) rename all tags with certain key prefix


 The presence (or absence) and the validity (in terms of data types and simple numerical
 requirements) of tags may be tested using

 - TQTaggable::claimTags(...) test validity of tags


 Useful string parsing utilities provided by the TQTaggable class are

 - TQTaggable::importTags(...) parses a string with comma-separated key-value
  assignments, e.g. "hello = world, x = 5"

 - TQTaggable::parseParameterList(...) parses a string with (not necessarily comma-)
  separated values, e.g. "'test', 4, 1"

 - TQTaggable::parseFlags(...) parses a string with flags and optional
  parameters, e.g. "abc4"

 Would be nice to have at some point but has not yet been finalized:

 "||key" logical OR of all tags 'key' upwards
 "&&key" logical AND of all tags 'key' upwards
 "key||" logical OR of all tags 'key' downwards
 "key&&" logical AND of all tags 'key' downwards

 "+key" SUM of all tags 'key' upwards
 "*key" PRODUCT of all tags 'key' upwards
 "key+" SUM of all tags 'key' downwards
 "key*" PRODUCT of all tags 'key' downwards

 "#key" number of occurences of tags 'key' upwards
 "key#" number of occurences of tags 'key' downwards


Function Members (Methods)

public:
virtual~TQTaggable()
boolallTagsOfTypeBool()
boolallTagsOfTypeDouble()
boolallTagsOfTypeInteger()
boolallTagsOfTypeString()
boolallTagsValidBools()
boolallTagsValidDoubles()
boolallTagsValidIntegers()
boolcanSetThisTag(const TString& key, bool& treatAsList)
intclaimTags(const TString& definition, bool printErrMsg = false)
intclaimTags(const TString& definition, TString& message)
intclaimTags(const TString& definition, TString& missing, TString& invalid, TString& unexpected)
static TClass*Class()
voidclear()
intclearTags()
intcountMatchingTags(const TString& name) const
boolexportConfigFile(bool writeUnreadKeys = true)
boolexportConfigFile(const TString& filename, bool writeUnreadKeys = true)
boolexportConfigFile(const TString& filename, const TString& prefix, bool writeUnreadKeys = true)
intexportTags(TQTaggable* dest, const TString& subDest = "", const TString& filter = "", bool recursive = false)
TStringexportTagsAsConfigString(const TString& prefix, const TString& filter = "")
stringexportTagsAsStandardConfigString(const TString& prefix, const TString& filter = "")
stringexportTagsAsStandardString(const TString& filter = "", bool xmlStyle = false)
TStringexportTagsAsString(const TString& filter = "", bool xmlStyle = false)
virtual TQTaggable*getBaseTaggable() const
virtual TList*getDescendantTaggables()
virtual TStringgetFlags()
intgetFlagsSize()
boolgetGlobalIgnoreCase() const
boolgetGlobalOverwrite() const
static shared_ptr<TQTaggable>getGlobalTaggable(const char* name)
static shared_ptr<TQTaggable>getGlobalTaggable(const TString& name)
TList*getListOfKeys(const TString& filter = "")
virtual TList*getListOfTaggables(const TString& name)
TList*getListOfTagNames()
virtual TList*getListOfUnreadKeys(const TString& filter = "")
intgetNTags() const
boolgetTag(const TString& key, double& value)
boolgetTag(const TString& key, int& value)
boolgetTag(const TString& key, bool& value)
boolgetTag(const TString& key, TString& value)
intgetTag(const TString& key, vector<TString>& vec)
intgetTag(const TString& key, vector<int>& vec)
intgetTag(const TString& key, vector<double>& vec)
intgetTag(const TString& key, vector<bool>& vec)
intgetTag(const TString& key, TList* l)
boolgetTag(const TString& key, double& value, bool recursive)
boolgetTag(const TString& key, int& value, bool recursive)
boolgetTag(const TString& key, bool& value, bool recursive)
boolgetTag(const TString& key, TString& value, bool recursive)
boolgetTagAsString(const TString& key, TString& tag)
boolgetTagBool(const TString& key, bool& value)
boolgetTagBool(const TString& key, bool& value, bool recursive)
boolgetTagBoolDefault(const TString& key, bool defaultVal = false)
doublegetTagDefault(const TString& key, double defaultVal)
intgetTagDefault(const TString& key, int defaultVal)
boolgetTagDefault(const TString& key, bool defaultVal)
TStringgetTagDefault(const TString& key, const TString& defaultVal)
TStringgetTagDefault(const TString& key, const char* defaultVal)
boolgetTagDouble(const TString& key, double& value)
boolgetTagDouble(const TString& key, double& value, bool recursive)
doublegetTagDoubleDefault(const TString& key, double defaultVal = 0.)
virtual TList*getTaggablesByName(const TString& name)
boolgetTagInteger(const TString& key, int& value)
boolgetTagInteger(const TString& key, int& value, bool recursive)
intgetTagIntegerDefault(const TString& key, int defaultVal = 0)
TList*getTagList(const TString& key)
intgetTagListLength(const TString& key)
intgetTagsSize()
stringgetTagStandardStringDefault(const TString& key, const TString& defaultVal = "")
boolgetTagString(const TString& key, TString& value)
boolgetTagString(const TString& key, TString& value, bool recursive)
TStringgetTagStringDefault(const TString& key, const TString& defaultVal = "")
vector<bool>getTagVBool(const TString& key)
vector<double>getTagVDouble(const TString& key)
vector<int>getTagVInt(const TString& key)
vector<int>getTagVInteger(const TString& key)
vector<string>getTagVStandardString(const TString& key)
vector<TString>getTagVString(const TString& key)
boolgetTypeOfTagAsString(const TString& key, TString& type)
static const TString&getValidKeyCharacters()
boolgetValueOfTagAsString(const TString& key, TString& value)
TStringgetValuesOfTags(const TString& keys, const TString& sep = ", ")
boolhasEquivalentTag(const TQValue* reference, bool recurseUp = true)
boolhasEquivalentTag(const TQValue& reference, bool recurseUp = true)
boolhasEquivalentTag(const TString& key, const TString& value)
boolhasEquivalentTag(const TString& key, const double value)
boolhasEquivalentTag(const TString& key, const int value)
boolhasEquivalentTag(const TString& key, const bool value)
static boolhasGlobalTaggable(const char* name)
static boolhasGlobalTaggable(const TString& name)
boolhasMatchingTag(const TString& name) const
boolhasTag(const TString& key)
boolhasTagBool(const TString& key)
boolhasTagDouble(const TString& key)
boolhasTagInteger(const TString& key)
boolhasTagString(const TString& key)
boolhasTagWithIndex(const TString& key)
boolhasTagWithoutIndex(const TString& key)
virtual boolhasUnreadKeys(const TString& filter = "")
intimportTag(TString tag, bool overwrite = true, bool keepStringQuotes = false)
intimportTags(TString tags, bool overwrite = true, bool keepStringQuotes = false)
intimportTags(const TQTaggable* tags, bool overwrite = true, bool recursive = false)
intimportTags(shared_ptr<TQTaggable> tags, bool overwrite = true, bool recursive = false)
intimportTags(const TQTaggable& tags, bool overwrite = true, bool recursive = false)
intimportTagsWithoutPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false)
intimportTagsWithoutPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false)
intimportTagsWithPrefix(TString tags, const TString& prefix, bool overwrite = true, bool keepStringQuotes = false, TString fallbackKey = "")
intimportTagsWithPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
intimportTagsWithPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
intimportTagWithPrefix(const TString& tag, const TString& prefix, bool overwrite = true, TString fallbackKey = "", bool keepStringQuotes = false)
virtual TClass*IsA() const
boolisTagOverwrittenByDescendants(TString key)
static boolisValidKey(const TString& key)
static TList*makeListOfTags(TList* unTags)
virtual voidonAccess(TQValue* tag)
virtual voidonRead(TQValue* tag)
virtual voidonWrite(TQValue* tag)
TQTaggable&operator=(const TString& s)
TQTaggable&operator=(const char* s)
TQTaggable&operator=(const TQTaggable& other)
static TQTaggable*parseFlags(const TString& flags)
boolparseKey(TString key, TString& bareKey, int& opUp, int& opDown)
static TQTaggable*parseParameterList(const TString& parameter, const TString& sep = ",", bool trim = true, const TString& blocks = "", const TString& quotes = "")
intprintClaim(const TString& definition)
boolprintDiffOfTags(TQTaggable* tags, const TString& options = "")
boolprintDiffOfTags(TQTaggable* tags, TQTaggable& options)
voidprintTags(TString options = "r")
static boolremoveGlobalTaggable(const char* name)
static boolremoveGlobalTaggable(const TString& name)
intremoveTag(const TString& key)
intremoveTags(const TString& key)
boolrenameTag(const TString& oldKey, const TString& newKey)
intrenameTags(const TString& oldPrefix, const TString& newPrefix)
stringreplaceInStandardString(const TString& in, bool keepQuotes = false)
stringreplaceInStandardString(const TString& in, const char* prefix, bool keepQuotes = false)
stringreplaceInStandardString(const TString& in, const TString& prefix, bool keepQuotes = false)
stringreplaceInStandardStringRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
intreplaceInTags(TQTaggable& params, const TString& tagFilter = "*")
TStringreplaceInText(const TString& in, bool keepQuotes = false)
TStringreplaceInText(const TString& in, const char* prefix, bool keepQuotes = false)
TStringreplaceInText(const TString& in, const TString& prefix, bool keepQuotes = false)
TStringreplaceInText(const TString& in, int& nReplaced, int& nFailed, bool keepQuotes = false)
TStringreplaceInText(TString in, int& nReplaced, int& nFailed, const TString& prefix, bool keepQuotes = false)
TStringreplaceInTextRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
virtual voidresetReadFlags()
voidsetGlobalIgnoreCase(bool globalIgnoreCase = true)
voidsetGlobalOverwrite(bool globalOverwrite = true)
intsetTag(const TString& key, double value, const TString& destination = "")
intsetTag(const TString& key, int value, const TString& destination = "")
intsetTag(const TString& key, bool value, const TString& destination = "")
intsetTag(const TString& key, const TString& value, const TString& destination = "")
intsetTag(const TString& key, const char* value, const TString& destination = "")
intsetTag(const char* key, double value, const TString& destination = "")
intsetTag(const char* key, int value, const TString& destination = "")
intsetTag(const char* key, bool value, const TString& destination = "")
intsetTag(const char* key, const TString& value, const TString& destination = "")
intsetTag(const char* key, const char* value, const TString& destination = "")
intsetTagAuto(const TString& key, TString value, const TString& destination = "")
intsetTagBool(TString key, bool value, const TString& destination = "")
intsetTagDouble(TString key, double value, const TString& destination = "")
intsetTagInteger(TString key, int value, const TString& destination = "")
intsetTagList(const TString& key, TString value, const TString& destination = "")
intsetTagString(TString key, const TString& value, const TString& destination = "")
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
booltagIsOfTypeBool(const TString& key)
booltagIsOfTypeDouble(const TString& key)
booltagIsOfTypeInteger(const TString& key)
booltagIsOfTypeString(const TString& key)
booltagsAreEquivalentTo(TQTaggable* tags, const TString& filter = "")
TQTaggable()
TQTaggable(const TString& tags)
TQTaggable(const char* tags)
TQTaggable(TQTaggable* tags)
TQTaggable(const TQTaggable& tags)
protected:
intcountTagDown(const TString& key)
intcountTagUp(const TString& key)
TQValue*findTag(TString name)
TList*getListOfTags()
boolgetOp(const TString& op, int& opCode)
boolgetTag(const TString& key, TQValue*& tag)
intsetTag(TQValue* tag, const TString& destination = "")
intsetTag(TQValue* tag, const TString& destination, bool overwrite)
private:
virtual Bool_tCheckTObjectHashConsistency() const

Data Members

protected:
boolfGlobalIgnoreCase!
boolfGlobalOverwrite!
TList*fReadFlags!
TList*fTags
static TQTaggable::(anonymous)kOpADD
static TQTaggable::(anonymous)kOpAND
static TQTaggable::(anonymous)kOpCNT
static TQTaggable::(anonymous)kOpMULT
static TQTaggable::(anonymous)kOpNone
static TQTaggable::(anonymous)kOpOR
static TQTaggable::(anonymous)kOpRec
static map<TString,shared_ptr<TQTaggable> >sGlobalTaggables

Class Charts

Inheritance Chart:
TQTaggable
TQAnalysisSampleVisitorBase
TQAnalysisSampleVisitor
TQMultiChannelAnalysisSampleVisitor
TQFolder
TQSampleFolder
TQSample
TQSystematicsHandler
TQGridScanResults
TQGridScanner
TQNamedTaggable
 [more...]

Function documentation

TQTaggable()
 Creates a new instance of the TQTaggable class without any tags set.
TQTaggable(const TString& tags)
 Creates a new instance of TQTaggable and tries to interpret the input string
 <tags> as comma-separated key-value assignments (see TQTaggable::importTags(...)).
 In case "--" is prepended the following string will be interpreted as flags
 (see TQTaggable:parseFlags(...)).
TQTaggable(const char* tags)
 Creates a new instance of TQTaggable and tries to interpret the input string
 <tags> as comma-separated key-value assignments (see TQTaggable::importTags(...)).
 In case "--" is prepended the following string will be interpreted as flags
 (see TQTaggable:parseFlags(...)).
TQTaggable(TQTaggable* tags)
 Creates a new instance of TQTaggable and imports tags assigned to <tags> to
 this instance.
TQTaggable(const TQTaggable& tags)
 Creates a new instance of TQTaggable and imports tags assigned to <tags> to
 this instance.
TQTaggable * getBaseTaggable() const
 Returns a pointer to the base instance of TQTaggable in a tree of TQTaggables.
 This method is supposed to be overwritten by a descendant class implementing
 the management of a tree-like structure of TQTaggables.
TList * getDescendantTaggables()
 default: no descendant taggables
TList * getTaggablesByName(const TString& name)
 default: no taggables around
TList * getListOfTaggables(const TString& name)
 default: no taggables around
const TString& getValidKeyCharacters()
 return the list of all valid key characters
bool isValidKey(const TString& key)
 Returns true if <key> is a valid key and false otherwise.
void resetReadFlags()
 reset the counting of which flags have been read already
bool hasUnreadKeys(const TString& filter = "")
 get the list of unread keys
TList * getListOfUnreadKeys(const TString& filter = "")
void onAccess(TQValue* tag)
void onRead(TQValue* tag)
void onWrite(TQValue* tag)
TQTaggable * parseFlags(const TString& flags)
 Reads the input string <flags>, interprets it as a set of flags with optional
 parameters, and in case of success returns an instance of TQTaggable with tags
 set corresponding to the flags and its parameters listed in the input string
 (the user is responsible for deleting the returned instance). Returns a null
 pointer in case of failure. Please note: this method returns a new instance of
 TQTaggable even if there are no flags, e.g. if an empty string has been passed,
 parseFlags(""). A flag is usually represented by a single letter, also allowing
 for flags with more than one letter. Optionally, the flag might come with an
 additional parameter, either of type string or integer.

 "a" occurence of flag "a", resulting in tag "a = true"
 "a6" flag "a" coming with integer parameter (6), resulting in tag "a = 6"
 "a[test]" flag "a" coming with string parameter ("test"), resulting in tag
 "a = 'test'"

 Boolean flags (simple occurence) can be negated by prepending "!":

 "!a" negated occurence of flag "a", resulting in tag "a = false"

 Flags may be made of more than one single letter by enclosing its full name in "<>":

 "<myFlag>" occurence of flag "myFlag", resulting in tag "myFlag = true"

 Multiple flags are listed by simple string concatenation:

 "abc" occurence of flags "a", "b", and "c", resulting in tags "a = true,
 b = true, c = true"
 "ab5c[hello]" occurence of flag "a", flag "b" coming with integer parameter (5),
 and flag "c" coming with string parameter ("hello"), resulting in
 tags "a = true, b = 5, c = 'hello'"
 "a-2<flag>5" flag "a" coming with integer parameter (-2) and flag "flag" coming
 with integer parameter (5), resulting in tags "a = -2, flag = 5"

 This method is used to parse option flags to several functions of TQx classes.

 The inverse of TQTaggable::parseFlags(...) is TQTaggable::getFlags().
TString getFlags()
 Creates and returns a string representing the tags associated to this instance
 of TQTaggable as flags (see TQTaggable::parseFlags(...) for detailed information).
int setTag(TQValue* tag, const TString& destination, bool overwrite)
void setGlobalIgnoreCase(bool globalIgnoreCase = true)
bool getGlobalIgnoreCase() const
void setGlobalOverwrite(bool globalOverwrite = true)
bool getGlobalOverwrite() const
TQValue * findTag(TString name)
bool hasMatchingTag(const TString& name) const
 return true if a tag matching the expression exists, false otherwise
int countMatchingTags(const TString& name) const
 count tags matching expression
bool hasEquivalentTag(const TQValue* reference, bool recurseUp = true)
bool hasEquivalentTag(const TQValue& reference, bool recurseUp = true)
wrapper for pointer variant
bool hasEquivalentTag(const TString& key, const TString& value)
 check if there is a tag for the given key and if its value is equivalent
 to the given one
bool hasEquivalentTag(const TString& key, const double value)
bool hasEquivalentTag(const TString& key, const int value)
bool hasEquivalentTag(const TString& key, const bool value)
bool isTagOverwrittenByDescendants(TString key)
bool getTag(const TString& key, TQValue*& tag)
int getTagsSize()
 return the size of all the tags in this object
int getFlagsSize()
 return the size of all the tags in this object
TList * getListOfKeys(const TString& filter = "")
bool tagsAreEquivalentTo(TQTaggable* tags, const TString& filter = "")
bool printDiffOfTags(TQTaggable* tags, const TString& options = "")
bool printDiffOfTags(TQTaggable* tags, TQTaggable& options)
int removeTag(const TString& key)
int removeTags(const TString& key)
 remove all tags matching the given key and return their number
bool renameTag(const TString& oldKey, const TString& newKey)
 Renames tag with key <oldKey> to key <newKey> and returns true if renaming was
 successful and false otherwise. Renaming fails if <newKey> is not a valid key
 or a tag with key <newKey> already exists.
int renameTags(const TString& oldPrefix, const TString& newPrefix)
 Renames all tags with keys that begin with <oldPrefix> replacing <oldPrefix>
 by <newPrefix> and returns the number of tags that were successfully renamed.
void clear()
 Removes and deletes all tags of this instance of TQTaggable ansd returns the
 number of tags that have been removed.
int clearTags()
 Removes and deletes all tags of this instance of TQTaggable ansd returns the
 number of tags that have been removed.
int printClaim(const TString& definition)
int claimTags(const TString& definition, bool printErrMsg = false)
int claimTags(const TString& definition, TString& message)
int claimTags(const TString& definition, TString& missing, TString& invalid, TString& unexpected)
 Tests the compatibility of the tags associated to this instance of TQTaggable
 with an expectation encoded in the input string <definition> and returns 1
 if tags are compatible and 0 otherwise. Basically, <definition> is a
 comma-separated list of keys that need to exist as tags. Wildcards "?" and "*"
 may be used, in which case at least one tag with a key matching the pattern
 has to exist:

 - expected tag(s): "key, myTag, style.*"

 If a "!" is prepended to a key name a corresponding tag is expected to not be
 present:

 - unaccepted tag: "!key"

 Tags may be expected to have a certain data type or to be convertable to
 certain data types (i = integer, d = double, b = bool, s = string):

 - expect data type for tag: "key:d!"
 - expect tag to be convertable to data types: "key:id"

 Here, the "!" appended to a data type (or a list of data types) indicates that
 the tag has to have one of the listed data types (logical OR). In case no "!"
 is appended the tag is required to be convertable to every listed data type
 (logical AND).

 Tags may be marked as optional by enclosing the corresponding part in "[]":

 - optional tags: "[key], [style.color.*:i!]"

 If "!!" appears as one entry in the comma-separated list <definition> no tag
 with a key other than the listed ones is expected:

 - expect only listed keys: "key, myTag, style.*, !!"

 Numerical tags may be required to fulfill a certain condition, e.g. must be
 positive (operators "==", "!=", ">=", ">", "<=", and "<" are supported):

 - Tags must be positive: "myKeys*:d:>0"
 - Tags must not be zero: "myKeys*:d:!=0"

 The value -1 is returned in case the definition string could not be parsed
 properly.
 taggable fulfills claim? (will be set to zero in the course of
 this function once there is a tag not fulfilling the definition)
bool hasTag(const TString& key)
bool hasTagDouble(const TString& key)
bool hasTagInteger(const TString& key)
bool hasTagBool(const TString& key)
bool hasTagString(const TString& key)
bool tagIsOfTypeDouble(const TString& key)
bool tagIsOfTypeInteger(const TString& key)
bool tagIsOfTypeBool(const TString& key)
bool tagIsOfTypeString(const TString& key)
bool allTagsValidDoubles()
bool allTagsValidIntegers()
bool allTagsValidBools()
bool allTagsOfTypeDouble()
bool allTagsOfTypeInteger()
bool allTagsOfTypeBool()
bool allTagsOfTypeString()
int countTagUp(const TString& key)
int countTagDown(const TString& key)
bool getOp(const TString& op, int& opCode)
bool parseKey(TString key, TString& bareKey, int& opUp, int& opDown)
int getNTags() const
 Return the number of tags
void printTags(TString options = "r")
TList * getListOfTags()
TList * getListOfTagNames()
TQTaggable * parseParameterList(const TString& parameter, const TString& sep = ",", bool trim = true, const TString& blocks = "", const TString& quotes = "")
 Tries to interpret the input string <parameter> as a comma-separated list of
 values and returns a new instance of TQTaggable with the parameter values
 represented as tags with the keys corresponding to the index of occurence of
 the value in the list (the user is responsible for deleting the returned
 instance). Returns a null pointer in case of failure.

 "1, 6, 4" results in tags "0 = 1, 1 = 6, 2 = 4",
 "1, 'hello', 4" results in tags "0 = 1, 1 = 'hello', 2 = 4".
int importTagsWithPrefix(TString tags, const TString& prefix, bool overwrite = true, bool keepStringQuotes = false, TString fallbackKey = "")
the number of tags imported
int importTags(TString tags, bool overwrite = true, bool keepStringQuotes = false)
int importTagsWithPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
 import all tags from another TQTaggable object, appending a certain prefix
int importTagsWithPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
 import all tags from another TQTaggable object, appending a certain prefix
int importTagsWithoutPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false)
 import all tags from another TQTaggable object, filtering and removing a certain prefix
int importTagsWithoutPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false)
 import all tags from another TQTaggable object, filtering and removing a certain prefix
TList* makeListOfTags(TList* unTags)
 convert a list of objects into a list of TQValue objects -- legacy converter function
int importTags(const TQTaggable* tags, bool overwrite = true, bool recursive = false)
 import a list of tags
int importTags(shared_ptr<TQTaggable> tags, bool overwrite = true, bool recursive = false)
 import a list of tags
int importTags(const TQTaggable& tags, bool overwrite = true, bool recursive = false)
 import a list of tags
int importTagWithPrefix(const TString& tag, const TString& prefix, bool overwrite = true, TString fallbackKey = "", bool keepStringQuotes = false)
 import a tag with a prefix
int importTag(TString tag, bool overwrite = true, bool keepStringQuotes = false)
 import a tag
int setTag(const TString& key, const TString& value, const TString& destination = "")
 set a single string tag
int setTag(const TString& key, const char* value, const TString& destination = "")
 set a single string tag
int setTag(const TString& key, double value, const TString& destination = "")
 set a single double-precision floating point tag
int setTag(const TString& key, int value, const TString& destination = "")
 set a single integer tag
int setTag(const TString& key, bool value, const TString& destination = "")
 set a single bool tag
int setTag(const char* key, const TString& value, const TString& destination = "")
 set a single string tag
int setTag(const char* key, const char* value, const TString& destination = "")
 set a single string tag
int setTag(const char* key, double value, const TString& destination = "")
 set a single double-precision floating point tag
int setTag(const char* key, int value, const TString& destination = "")
 set a single integer tag
int setTag(const char* key, bool value, const TString& destination = "")
 set a single bool tag
bool hasTagWithIndex(const TString& key)
 Takes a tag name and returns true if this key already exists with an index.
 Example: argument is "keyName". If "keyName."<integer> exists, return true,
 otherwise false.
bool hasTagWithoutIndex(const TString& key)
 Takes a tag name and returns true if this key already exists without an index.
 Example: argument is "keyName.3". If "keyName" exists, return true, otherwise
 false.
bool canSetThisTag(const TString& key, bool& treatAsList)
 returns if the tag should be set (only relevant if globalOverwrite is false)
 the input treatAsList is ignored. It returned as true if the tag already exists with an index
int setTagAuto(const TString& key, TString value, const TString& destination = "")
 set a tag, automatically picking the type
int setTagList(const TString& key, TString value, const TString& destination = "")
 set a list of tags
int setTagDouble(TString key, double value, const TString& destination = "")
 set a single double-precision floating point number tag
int setTagInteger(TString key, int value, const TString& destination = "")
 set a single integer tag
int setTagBool(TString key, bool value, const TString& destination = "")
 set a single bool tag
int setTagString(TString key, const TString& value, const TString& destination = "")
 set a single string tag
int exportTags(TQTaggable* dest, const TString& subDest = "", const TString& filter = "", bool recursive = false)
 export the tags to another taggable object
TString exportTagsAsString(const TString& filter = "", bool xmlStyle = false)
 export the tags as a string
TString exportTagsAsConfigString(const TString& prefix, const TString& filter = "")
 export the tags to a config string
TString replaceInText(const TString& in, const TString& prefix, bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
TString replaceInTextRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
 this version of the function recursively replaces the string until no resolvable tag is left
TString replaceInText(const TString& in, const char* prefix, bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
TString replaceInText(const TString& in, bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
TString replaceInText(const TString& in, int& nReplaced, int& nFailed, bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
TString replaceInText(TString in, int& nReplaced, int& nFailed, const TString& prefix, bool keepQuotes = false)
 replace all placeholders $(xyz) by their respective tagged values "xyz = abc"
TString getValuesOfTags(const TString& keys, const TString& sep = ", ")
 replace keys by values in a comma-separated string list
std::vector<TString > getTagVString(const TString& key)
 retrieve a list of tags as a vector of strings
TList* getTagList(const TString& key)
 retrieve a list of tags
std::vector<int > getTagVInt(const TString& key)
 retrieve a list of tags as a vector of integers
std::vector<int > getTagVInteger(const TString& key)
 retrieve a list of tags as a vector of integers
std::vector<double> getTagVDouble(const TString& key)
 retrieve a list of tags as a vector of doubles
std::vector<bool > getTagVBool(const TString& key)
 retrieve a list of tags as a vector of bool
int getTag(const TString& key, vector<TString>& vec)
 get a list of tags
int getTag(const TString& key, TList* l)
 get a list of tags
int getTagListLength(const TString& key)
 get the length of a list of tags
int getTag(const TString& key, vector<double>& vec)
 get a list of double-precision floating point tags
int getTag(const TString& key, vector<int>& vec)
 get a list of integer tags
int getTag(const TString& key, vector<bool>& vec)
 get a list of boolean tags
bool getTag(const TString& key, double& value)
 get a single double-precision floating point tag
bool getTag(const TString& key, int& value)
 get a single integer tag
bool getTag(const TString& key, bool& value)
 get a single boolean tag
bool getTag(const TString& key, TString& value)
 get a single string tag
bool getTagDouble(const TString& key, double& value)
 get a single double-precision floating point tag
bool getTagInteger(const TString& key, int& value)
 get a single integer tag
bool getTagBool(const TString& key, bool& value)
 get single boolean tag
bool getTagString(const TString& key, TString& value)
 get a single string tag
double getTagDefault(const TString& key, double defaultVal)
 get a single double-precision floating point tag
int getTagDefault(const TString& key, int defaultVal)
 get a single integer tag
bool getTagDefault(const TString& key, bool defaultVal)
 get a single boolean tag
TString getTagDefault(const TString& key, const TString& defaultVal)
 get a single string tag
TString getTagDefault(const TString& key, const char* defaultVal)
 get a single string tag
double getTagDoubleDefault(const TString& key, double defaultVal = 0.)
 get a single double-precision floating point tag
int getTagIntegerDefault(const TString& key, int defaultVal = 0)
 get a single integer tag
bool getTagBoolDefault(const TString& key, bool defaultVal = false)
 get a single boolean tag
TString getTagStringDefault(const TString& key, const TString& defaultVal = "")
 get a single string tag
bool getTagAsString(const TString& key, TString& tag)
 get single string tag
bool getTypeOfTagAsString(const TString& key, TString& type)
 get the type of a tag as a string
bool getValueOfTagAsString(const TString& key, TString& value)
 get the value of a tag as a string
~TQTaggable()
 standard destructor
bool getTag(const TString& key, double& value, bool recursive)
 get a single double-precision floating point tag
bool getTag(const TString& key, int& value, bool recursive)
 get a single integer tag
bool getTag(const TString& key, bool& value, bool recursive)
 get a single boolean tag
bool getTag(const TString& key, TString& value, bool recursive)
 get a single string tag
bool getTagDouble(const TString& key, double& value, bool recursive)
 get a single double-precision floating point tag
bool getTagInteger(const TString& key, int& value, bool recursive)
 get a single integer tag
bool getTagBool(const TString& key, bool& value, bool recursive)
 get a single boolean tag
bool getTagString(const TString& key, TString& value, bool recursive)
 get a single string tag
bool exportConfigFile(const TString& filename, const TString& prefix, bool writeUnreadKeys = true)
 export the tags to a config file
bool exportConfigFile(const TString& filename, bool writeUnreadKeys = true)
@tag:[.configname] This object tag determines the prefix when exporting to a configuration file. Default: "Config"
bool exportConfigFile(bool writeUnreadKeys = true)
@tag:[.filename] This object tag determines the filename when exporting to a configuration file. Default: "config.cfg"
int replaceInTags(TQTaggable& params, const TString& tagFilter = "*")
 Replace tag placeholders in tags set on this instance of TQTaggable
 according to the tags set on the TQTaggable object provided. A tag filter
 can be specified to only perform the replacement where the key of a tag
 matches the filter expression.
std::string exportTagsAsStandardString(const TString& filter = "", bool xmlStyle = false)
 wrapper for the TString variant of this function
std::string exportTagsAsStandardConfigString(const TString& prefix, const TString& filter = "")
 wrapper for the TString variant of this function
std::string replaceInStandardStringRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
 wrapper for the TString variant of this function
std::string replaceInStandardString(const TString& in, const char* prefix, bool keepQuotes = false)
 wrapper for the TString variant of this function
std::string replaceInStandardString(const TString& in, const TString& prefix, bool keepQuotes = false)
 wrapper for the TString variant of this function
std::string replaceInStandardString(const TString& in, bool keepQuotes = false)
 wrapper for the TString variant of this function
std::string getTagStandardStringDefault(const TString& key, const TString& defaultVal = "")
 wrapper for the TString variant of this function
std::vector<std::string > getTagVStandardString(const TString& key)
 wrapper for the TString variant of this function
std::shared_ptr<TQTaggable> getGlobalTaggable(const char* name)
 wrapper around TString variant
std::shared_ptr<TQTaggable> getGlobalTaggable(const TString& name)
bool hasGlobalTaggable(const char* name)
 wrapper around TString variant
bool hasGlobalTaggable(const TString& name)
bool removeGlobalTaggable(const char* name)
bool removeGlobalTaggable(const TString& name)
int setTag(TQValue* tag, const TString& destination, bool overwrite)
TQTaggable& operator=(const TString& s)
TQTaggable& operator=(const char* s)
TQTaggable& operator=(const TQTaggable& other)