9 std::string strTakeOut, strPutIn;
11 strTakeOut =
".oODOLLAROo.";
13 ipos = str.find(strTakeOut);
14 while (ipos!=std::string::npos){ str.replace(ipos, strTakeOut.length(), strPutIn.c_str()); ipos = str.find(strTakeOut); }
15 strTakeOut =
".oOOPEN_BRACKETOo.";
17 ipos = str.find(strTakeOut);
18 while (ipos!=std::string::npos){ str.replace(ipos, strTakeOut.length(), strPutIn.c_str()); ipos = str.find(strTakeOut); }
19 strTakeOut =
".oOCLOSE_BRACKETOo.";
21 ipos = str.find(strTakeOut);
22 while (ipos!=std::string::npos){ str.replace(ipos, strTakeOut.length(), strPutIn.c_str()); ipos = str.find(strTakeOut); }
24 static std::regex env(
"\\$\\{([^}]+)\\}");
26 while (std::regex_search(str, match, env)){
27 const char* s = getenv(match[1].str().c_str());
28 const std::string var(s == NULL ?
"" : s);
29 str.replace(match[0].first, match[0].
second, var);