MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / GetConfigDir

Function GetConfigDir

src/common/cli.cpp:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// ── Platform-specific paths ─────────────────────────────────────────────
38
39static std::string GetConfigDir() {
40#ifdef _WIN32
41 wchar_t* appDataPath = nullptr;
42 if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &appDataPath))) {
43 int len = WideCharToMultiByte(CP_UTF8, 0, appDataPath, -1, nullptr, 0, nullptr, nullptr);
44 std::string result(len - 1, '\0');
45 WideCharToMultiByte(CP_UTF8, 0, appDataPath, -1, result.data(), len, nullptr, nullptr);
46 CoTaskMemFree(appDataPath);
47 return result + "\\CloudRedirect\\";
48 }
49 return "";
50#else
51 return XdgConfigHome() + "/CloudRedirect/";
52#endif
53}
54
55static std::string GetTokenPath(const std::string& provider) {
56 std::string configDir = GetConfigDir();

Callers 3

GetTokenPathFunction · 0.85
GetConfigFilePathMethod · 0.85
ReadModeSettingMethod · 0.85

Calls 1

XdgConfigHomeFunction · 0.85

Tested by

no test coverage detected