MCPcopy Create free account
hub / github.com/WinMerge/winmerge / ExpandEnvironmentVariables

Function ExpandEnvironmentVariables

Src/Environment.cpp:198–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198String ExpandEnvironmentVariables(const String& text)
199{
200 tchar_t buf[512];
201 buf[0] = 0;
202 const unsigned size = sizeof(buf) / sizeof(buf[0]);
203 const unsigned expandedSize = ::ExpandEnvironmentStrings(text.c_str(), buf, size);
204 if (expandedSize <= size)
205 return buf;
206 std::vector<tchar_t> newbuf(expandedSize);
207 ::ExpandEnvironmentStrings(text.c_str(), newbuf.data(), expandedSize);
208 return newbuf.data();
209}
210
211/**
212 * @brief Load registry keys from .reg file if existing .reg file

Callers 3

LoadListImplFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected