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