MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetEnvironmentVariable

Method GetEnvironmentVariable

Source/Engine/Platform/GDK/GDKPlatform.cpp:598–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598bool GDKPlatform::GetEnvironmentVariable(const String& name, String& value)
599{
600 const int32 bufferSize = 512;
601 Char buffer[bufferSize];
602 DWORD result = GetEnvironmentVariableW(*name, buffer, bufferSize);
603 if (result == 0)
604 {
605 LOG_WIN32_LAST_ERROR;
606 return true;
607 }
608 if (bufferSize < result)
609 {
610 value.ReserveSpace(result);
611 result = GetEnvironmentVariableW(*name, *value, result);
612 if (!result)
613 {
614 LOG_WIN32_LAST_ERROR;
615 return FALSE;
616 }
617 }
618 else
619 {
620 value.Set(buffer, result);
621 }
622 return false;
623}
624
625bool GDKPlatform::SetEnvironmentVariable(const String& name, const String& value)
626{

Callers

nothing calls this directly

Calls 2

ReserveSpaceMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected