MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ProgramDataPath

Function ProgramDataPath

lib/mdflib/mdfviewer/src/util/logconfig.cpp:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace util::log {
20
21std::string ProgramDataPath() {
22 std::string app_data_path;
23#ifdef WIN32
24 WCHAR *path = nullptr;
25 const auto ret =
26 ::SHGetKnownFolderPath(FOLDERID_ProgramData, 0, nullptr, &path);
27 if (ret == S_OK) {
28 const std::wstring temp(path);
29 std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> conv;
30 app_data_path = conv.to_bytes(temp);
31 }
32 if (path != nullptr) {
33 CoTaskMemFree(path);
34 }
35#endif
36
37 return app_data_path;
38}
39LogConfig &LogConfig::Instance() {
40 static LogConfig log_config;
41 return log_config;

Callers 1

FindLogPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected