MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / getEnviron

Function getEnviron

source/MaterialXFormat/Environ.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#endif
14
15MATERIALX_NAMESPACE_BEGIN
16
17string getEnviron(const string& name)
18{
19#if defined(_WIN32)
20 if (uint32_t size = GetEnvironmentVariableA(name.c_str(), nullptr, 0))
21 {
22 vector<char> buffer(size);
23 GetEnvironmentVariableA(name.c_str(), buffer.data(), size);
24 return string(buffer.data());
25 }
26#else
27 if (const char* const result = getenv(name.c_str()))
28 {
29 return string(result);
30 }
31#endif
32 return EMPTY_STRING;
33}
34
35bool setEnviron(const string& name, const string& value)
36{

Callers 2

getBaseOutputPathMethod · 0.85
getEnvironmentPathFunction · 0.85

Calls 2

c_strMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected