Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
src
Utilities
EnvVariable.cpp
Go to the documentation of this file.
1
/* This file is part of MoDELib, distributed under GNU GPL v2. */
2
#include <
EnvVariable.h
>
3
#include <cstdlib>
4
#include <string.h>
5
#include <assert.h>
6
7
namespace
model
8
{
9
10
auto
EnvVariable::getVariable
(
const
std::string &varname) -> std::string
11
{
12
const
char
*tmpvar = std::getenv(varname.c_str());
13
assert(tmpvar != 0 && *tmpvar !=
'\0'
&&
"FAILED TO GET ENVIRONMENT VARIABLE."
);
14
return
tmpvar;
15
}
16
17
EnvVariable::EnvVariable
(
const
std::string &varname) : std::
string
(
getVariable
(varname))
18
{
19
}
20
}
// namespace model
EnvVariable.h
model
Definition
DD_converter.dox:2
model::EnvVariable::EnvVariable
EnvVariable(const std::string &varname)
Definition
EnvVariable.cpp:17
model::EnvVariable::getVariable
static std::string getVariable(const std::string &varname)
Definition
EnvVariable.cpp:10
string
char infilename char * string
Definition
triangle.cpp:13807
Generated by
1.15.0