9 #ifndef LLDB_UTILITY_ENVIRONMENT_H
10 #define LLDB_UTILITY_ENVIRONMENT_H
12 #include "llvm/ADT/StringMap.h"
13 #include "llvm/Support/Allocator.h"
14 #include "llvm/Support/FormatProviders.h"
19 using Base = llvm::StringMap<std::string>;
28 operator char *
const *()
const {
return get(); }
41 using Base::const_iterator;
43 using Base::value_type;
53 using Base::insert_or_assign;
56 using Base::try_emplace;
57 using Base::operator[];
63 :
Environment(const_cast<const char *const *>(Env)) {}
67 Base::operator=(std::move(RHS));
71 std::pair<iterator, bool>
insert(llvm::StringRef KeyEqValue) {
72 auto Split = KeyEqValue.split(
'=');
76 void insert(iterator first, iterator last);
81 return (KeyValue.first() +
"=" + KeyValue.second).str();
91 for (
const auto &KV : Env)
92 Stream <<
"env[" << KV.first() <<
"] = " << KV.second <<
"\n";
97 #endif // LLDB_UTILITY_ENVIRONMENT_H