MCPcopy Create free account
hub / github.com/avast/retdec / getStringThisBinaryPath

Function getStringThisBinaryPath

src/utils/binary_path.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace {
12
13std::string getStringThisBinaryPath(
14 std::size_t &directorySize)
15{
16 int pathSize = 0;
17 int dirPathSize = 0;
18 std::string result;
19
20 // Get length of path.
21 pathSize = wai_getExecutablePath(NULL, 0, &dirPathSize);
22
23 // Get path again.
24 if (pathSize > 0)
25 {
26 result.resize(pathSize);
27 wai_getExecutablePath(&result[0], pathSize, &dirPathSize);
28 }
29
30 directorySize = dirPathSize;
31 return result;
32}
33
34} // anonymous namespace
35

Callers 2

getThisBinaryPathFunction · 0.85

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected