-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath_info.hpp
More file actions
32 lines (26 loc) · 1.13 KB
/
Copy pathpath_info.hpp
File metadata and controls
32 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <string>
#include <utility>
#include <vector>
// `label` keeps a trailing space so the UI can draw the value immediately
// after it. Using a plain pair keeps this module drop-in compatible with the
// previous `cached_path_items_` field, which already had this type.
using PathItem = std::pair<std::wstring, std::wstring>;
// The namespace guards against Windows.h macros such as `GetWindowsDirectory`
// and `GetSystemDirectory` rewriting these names into their W/A variants.
namespace path_info
{
// Collect executable path, working dir, OS version, Wine/Proton marker, TEMP,
// Windows, System and save-file paths. All Win32 calls are sized from their
// own return values, so paths longer than MAX_PATH are not silently truncated.
std::vector<PathItem> Collect();
// Helpers exposed for unit tests and for callers that need only one value.
std::wstring ExecutablePath();
std::wstring CurrentWorkingDirectory();
std::wstring TempDirectory();
std::wstring WindowsDirectory();
std::wstring SystemDirectory();
std::wstring OsVersionString();
std::wstring WineOrProtonVersion();
std::wstring SaveFilePath();
} // namespace path_info