6 std::string i_resolve(std::string& source,
int recursions) {
7 if ( recursions > 0 ) {
8 int lvl = 0, mx_lvl = 0;
9 for(
const char*
c=source.c_str(), *beg=0; *
c != 0; ++
c) {
12 if ( *(
c+1) ==
'{' ) {
22 if ( lvl == mx_lvl ) {
23 std::string env(beg+2,
c-beg-2);
26 rep = i_resolve(env, --recursions);
28 std::string e(beg,
c-beg+1);
29 size_t idx=std::string::npos;
30 while((idx=source.find(e)) != std::string::npos) {
31 source.replace(idx, e.length(), rep);
33 return i_resolve(source, --recursions);
52 std::string source = var;
53 res = i_resolve(source, recursions);
54 if ( res.find(
"${") == std::string::npos ) {
62 std::string home_dir =
"./";
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
GAUDI_API std::string homeDirectory()
GAUDI_API StatusCode resolveEnv(const std::string &var, std::string &res, int recusions=124)
GAUDI_API std::string tempDirectory()
This class is used for returning status codes from appropriate routines.
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram