22inline namespace util {
27 const char*
const val{
getenv(name.c_str())};
28 return val ?
string{
val} :
string{};
41bool VarSub::substitute(
string&
s,
const size_t i,
size_t j, set<
string>*
outer)
const
49 while (
j <
s.size()) {
69 if (!substitute(
s,
j,
j + 2, &
inner)) {
86 auto name =
s.substr(
i + 2,
n - 2);
87 if (
outer->count(name) == 0) {
88 s.replace(
i,
n + 1, fn_(name));
89 outer->insert(std::move(name));