mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Moved some #ifdef _WIN32 blocks.
They now enclose the functions where there is no non-Windows implementation at all.
This commit is contained in:
@@ -195,10 +195,8 @@ namespace loot {
|
||||
else
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
boost::filesystem::path GetLocalAppDataPath() {
|
||||
#ifdef _WIN32
|
||||
HWND owner = 0;
|
||||
TCHAR path[MAX_PATH];
|
||||
|
||||
@@ -209,14 +207,12 @@ namespace loot {
|
||||
return fs::path(path);
|
||||
else
|
||||
return fs::path("");
|
||||
#endif
|
||||
}
|
||||
|
||||
//Turns an absolute filesystem path into a valid file:// URL.
|
||||
std::string ToFileURL(const fs::path& file) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Converting file path " << file << " to a URL.";
|
||||
|
||||
#ifdef _WIN32
|
||||
wstring wstr(MAX_PATH, 0);
|
||||
DWORD len = MAX_PATH;
|
||||
UrlCreateFromPath(ToWinWide(file.string()).c_str(), &wstr[0], &len, NULL);
|
||||
@@ -224,10 +220,8 @@ namespace loot {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Converted to: " << str;
|
||||
|
||||
return str;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
//Helper to turn UTF8 strings into strings that can be used by WinAPI.
|
||||
std::wstring ToWinWide(const std::string& str) {
|
||||
int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), 0, 0);
|
||||
|
||||
@@ -53,7 +53,6 @@ namespace loot {
|
||||
#ifdef _WIN32
|
||||
//Get registry subkey value string.
|
||||
std::string RegKeyStringValue(const std::string& keyStr, const std::string& subkey, const std::string& value);
|
||||
#endif
|
||||
|
||||
//Get the local application data path, within which LOOT's data folder should be stored.
|
||||
boost::filesystem::path GetLocalAppDataPath();
|
||||
@@ -61,7 +60,6 @@ namespace loot {
|
||||
//Turns an absolute filesystem path into a valid file:// URL.
|
||||
std::string ToFileURL(const boost::filesystem::path& file);
|
||||
|
||||
#ifdef _WIN32
|
||||
//Helper to turn UTF8 strings into strings that can be used by WinAPI.
|
||||
std::wstring ToWinWide(const std::string& str);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user