BOSS 6.6.4.p01
BESIII Offline Software System
|
#include <Util.h>
Static Public Member Functions | |
static int | expandEnvVar (std::string *toExpand, const std::string &openDel=std::string("$("), const std::string &closeDel=std::string(")")) |
static const char * | itoa (int val, std::string &outStr) |
static int | atoi (const std::string &InStr) |
converts an std::string to an integer | |
static double | stringToDouble (const std::string &InStr) |
static int | stringToInt (const std::string &InStr) |
static void | stringTokenize (std::string input, const std::string &delimiters, std::vector< std::string > &tokens, bool clear=true) |
static void | keyValueTokenize (std::string input, const std::string &delimiters, std::map< std::string, std::string > &tokenMap, const std::string &pairDelimiter=std::string("="), bool clear=true) |
static std::string | basename (const std::string &path) |
static unsigned | trimTrailing (std::string *toTrim) |
static int | expandEnvVar (std::string *toExpand, const std::string &openDel=std::string("$("), const std::string &closeDel=std::string(")")) |
static int | catchOptionVal (std::string *toCatch, const int ops=0, const std::string &openDel=std::string("#("), const std::string &closeDel=std::string(")")) |
static const char * | itoa (int val, std::string &outStr) |
static int | atoi (const std::string &InStr) |
converts an std::string to an integer | |
static double | stringToDouble (const std::string &InStr) |
static int | stringToInt (const std::string &InStr) |
static void | stringTokenize (std::string input, const std::string &delimiters, std::vector< std::string > &tokens, bool clear=true) |
static std::string | basename (const std::string &path) |
Definition at line 44 of file Calibration/facilities/facilities-00-00-03/facilities/Util.h.
|
static |
converts an std::string to an integer
Definition at line 82 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by catchOptionVal(), and calibUtil::Metadata::getReadInfo().
|
static |
converts an std::string to an integer
|
static |
return the "non-directory" part of a (supposed) file identifier, path. Environment variable translation should be done before calling basename.
path | string assumed to be a file identifier. |
Definition at line 161 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by main().
|
static |
return the "non-directory" part of a (supposed) file identifier, path. Environment variable translation should be done before calling basename.
path | string assumed to be a file identifier. |
|
static |
Given input string toCatch catch val from string opt, by default of the form #(opt) and remove "#(opt)" from the original string.
toCatch | string for which expansion is to be done |
openDel | opening delimiter (defaults to "#(") |
closeDel | closing delimiter (defaults to ")") |
Definition at line 60 of file Event/RootCnvSvc/RootCnvSvc-02-01-03/src/Util.cxx.
|
static |
Given input string toExpand expand references to environment variables, by default of the form and put the expanded version back into the original string. Alternate delimiters for the varname may optionally be specified
toExpand | string for which expansion is to be done |
openDel | opening delimiter (defaults to "$(") |
closeDel | closing delimiter (defaults to ")") |
TODO: Perhaps add optional arguments to specify alternate delimiters.
Referenced by XmlBaseCnv::createObj(), digiRootReaderAlg::initialize(), digiRootWriterAlg::initialize(), main(), calibUtil::Metadata::Metadata(), RootCalBaseCnv::openRead(), RootCalBaseCnv::openWrite(), and xmlBase::XmlParser::parse().
|
static |
Given input string toExpand expand references to environment variables, by default of the form and put the expanded version back into the original string. Alternate delimiters for the varname may optionally be specified
toExpand | string for which expansion is to be done |
openDel | opening delimiter (defaults to "$(") |
closeDel | closing delimiter (defaults to ")") |
TODO: Perhaps add optional arguments to specify alternate delimiters.
|
static |
Given an input integer val to convert and an output string outStr converts val into a std::string. This method duplicates the stdlib.h method itoa, except that it returns std::string rather than char*.
val | |
outStr | will be modified by this method |
Definition at line 55 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by rdbModel::MysqlConnection::dbRequest(), xmlBase::XmlErrorHandler::error(), xmlBase::XmlErrorHandler::fatalError(), calibUtil::Metadata::findBest(), calibUtil::Metadata::findSoonAfter(), calibUtil::Metadata::getReadInfo(), main(), calibUtil::Metadata::registerCalib(), rdbModel::MysqlConnection::select(), and rdbModel::Table::supersedeRow().
|
static |
Given an input integer val to convert and an output string outStr converts val into a std::string. This method duplicates the stdlib.h method itoa, except that it returns std::string rather than char*.
val | |
outStr | will be modified by this method |
|
static |
This routine breaks down a string into key/value token pairs and stores them in the user-supplied map. , based on the characters appearing in the string delimiters and the value of pairDelimiter. In a typical example, input could be "key1=val1,key2=val2,key3=val3". In this case invoke with delimiters=std::string(",") and pairDelimiter=std::string("=") (or omit pairDelimiter since it has the default value)
input | string to be tokenized |
delimiters | string containing one or more delimiter characters |
tokenMap | map of strings to hold resulting tokens |
pairDelimiter | string separating key and value; defaults to "=" |
clear | if true (default) tokens will be cleared at the start of processing |
Definition at line 139 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by main().
|
static |
converts a std::string to a double. If string contents are not of proper form, throws facilities::WrongType
Definition at line 104 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by xmlBase::IFile::getDouble(), xmlBase::Dom::getDoubleAttribute(), xmlBase::Dom::getDoublesAttribute(), xmlBase::Dom::getFloatsAttribute(), and main().
|
static |
converts a std::string to a double. If string contents are not of proper form, throws facilities::WrongType
|
static |
converts a std::string to an int. If string contents are not of proper form, throws facilities::WrongType
Definition at line 115 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by rdbModel::XercesBuilder::buildRdb(), Coverage::checkType(), xmlBase::IFile::getInt(), xmlBase::Dom::getIntAttribute(), xmlBase::Dom::getIntsAttribute(), rdbModel::MysqlResults::getRowCon(), main(), and rdbModel::MysqlConnection::open().
|
static |
converts a std::string to an int. If string contents are not of proper form, throws facilities::WrongType
|
static |
This routine breaks down a string into tokens, based on the characters appearing in the string delimiters.
input | string to be tokenized |
delimiters | string containing one or more delimiter characters |
tokens | vector of strings to hold resulting tokens |
clear | if true (default) tokens will be cleared at the start of processing |
Definition at line 125 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by basename(), xmlBase::Dom::getDoublesAttribute(), xmlBase::Dom::getFloatsAttribute(), xmlBase::Dom::getIntsAttribute(), keyValueTokenize(), and main().
|
static |
This routine breaksdown a string into tokens, based on the characters appearing in the string delimiters.
input | string to be tokenized |
delimiters | string containing one or more delimiter characters |
tokens | vector of strings to hold resulting tokens |
clear | if true (default) tokens will be cleared at the start of processing |
|
static |
Trim trailing white space characters from the supplied string. White space characters for this purpose are blank, carriage return, line feed and form feed. Return # of characters trimmed.
Definition at line 167 of file Calibration/facilities/facilities-00-00-03/src/Util.cxx.
Referenced by XmlBaseCnv::createObj(), and main().