stc
Loading...
Searching...
No Matches
FreeEnv.hpp
Go to the documentation of this file.
1#include "stc/Environment.hpp"
2
3namespace util {
4
8struct FreeEnv {
9 std::string name;
10
12 const std::string& name,
13 const std::string& initValue = ""
14 ) : name(name) {
15 if (!initValue.empty()) {
17 name.c_str(), initValue.c_str()
18 );
19 }
20 }
21
23 if (!name.empty()) {
24 stc::setEnv(name.c_str(), nullptr);
25 }
26 }
27};
28
29}
void setEnv(const char *name, const char *value, bool replace=true)
Definition Environment.hpp:44
Definition FreeEnv.hpp:3
Definition FreeEnv.hpp:8
std::string name
Definition FreeEnv.hpp:9
FreeEnv(const std::string &name, const std::string &initValue="")
Definition FreeEnv.hpp:11
~FreeEnv()
Definition FreeEnv.hpp:22