mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-24 04:18:23 -05:00
Remove detail namespaces. (#137)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include <os/logger_detail.h>
|
||||
#include <os/logger.h>
|
||||
|
||||
void os::logger::detail::Init()
|
||||
void os::logger::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void os::logger::detail::Log(const std::string_view str, detail::ELogType type, const char* func)
|
||||
void os::logger::Log(const std::string_view str, ELogType type, const char* func)
|
||||
{
|
||||
if (func)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <os/media_detail.h>
|
||||
#include <os/media.h>
|
||||
|
||||
bool os::media::detail::IsExternalMediaPlaying()
|
||||
bool os::media::IsExternalMediaPlaying()
|
||||
{
|
||||
// This functionality is not supported in Linux.
|
||||
return false;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <os/process_detail.h>
|
||||
#include <os/process.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
std::filesystem::path os::process::detail::GetExecutablePath()
|
||||
std::filesystem::path os::process::GetExecutablePath()
|
||||
{
|
||||
char exePath[PATH_MAX] = {};
|
||||
if (readlink("/proc/self/exe", exePath, PATH_MAX) > 0)
|
||||
@@ -15,7 +15,7 @@ std::filesystem::path os::process::detail::GetExecutablePath()
|
||||
}
|
||||
}
|
||||
|
||||
std::filesystem::path os::process::detail::GetWorkingDirectory()
|
||||
std::filesystem::path os::process::GetWorkingDirectory()
|
||||
{
|
||||
char cwd[PATH_MAX] = {};
|
||||
char *res = getcwd(cwd, sizeof(cwd));
|
||||
@@ -29,7 +29,7 @@ std::filesystem::path os::process::detail::GetWorkingDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
bool os::process::detail::StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work)
|
||||
bool os::process::StartProcess(const std::filesystem::path& path, const std::vector<std::string>& args, std::filesystem::path work)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
if (pid < 0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <os/user_detail.h>
|
||||
#include <os/user.h>
|
||||
|
||||
bool os::user::detail::IsDarkTheme()
|
||||
bool os::user::IsDarkTheme()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <os/version_detail.h>
|
||||
#include <os/version.h>
|
||||
|
||||
os::version::detail::OSVersion os::version::detail::GetOSVersion()
|
||||
os::version::OSVersion os::version::GetOSVersion()
|
||||
{
|
||||
assert(false && "Unimplemented.");
|
||||
return os::version::detail::OSVersion();
|
||||
return os::version::OSVersion();
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#include <os/logger.h>
|
||||
#include <os/logger_detail.h>
|
||||
|
||||
void os::logger::Init()
|
||||
{
|
||||
detail::Init();
|
||||
}
|
||||
|
||||
void os::logger::Log(const std::string_view str, detail::ELogType type, const char* func)
|
||||
{
|
||||
detail::Log(str, type, func);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <os/logger_detail.h>
|
||||
#include <source_location>
|
||||
|
||||
#define LOG_IMPL(type, func, str) os::logger::Log(str, os::logger::detail::ELogType::type, func)
|
||||
#define LOGF_IMPL(type, func, str, ...) os::logger::Log(fmt::format(str, __VA_ARGS__), os::logger::detail::ELogType::type, func)
|
||||
#define LOG_IMPL(type, func, str) os::logger::Log(str, os::logger::ELogType::type, func)
|
||||
#define LOGF_IMPL(type, func, str, ...) os::logger::Log(fmt::format(str, __VA_ARGS__), os::logger::ELogType::type, func)
|
||||
|
||||
// Function-specific logging.
|
||||
|
||||
@@ -51,6 +51,14 @@
|
||||
|
||||
namespace os::logger
|
||||
{
|
||||
enum class ELogType
|
||||
{
|
||||
None,
|
||||
Utility,
|
||||
Warning,
|
||||
Error
|
||||
};
|
||||
|
||||
void Init();
|
||||
void Log(const std::string_view str, detail::ELogType type = detail::ELogType::None, const char* func = nullptr);
|
||||
void Log(const std::string_view str, ELogType type = ELogType::None, const char* func = nullptr);
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <source_location>
|
||||
|
||||
namespace os::logger::detail
|
||||
{
|
||||
enum class ELogType
|
||||
{
|
||||
None,
|
||||
Utility,
|
||||
Warning,
|
||||
Error
|
||||
};
|
||||
|
||||
void Init();
|
||||
void Log(const std::string_view str, ELogType type = ELogType::None, const char* func = nullptr);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <os/media.h>
|
||||
#include <os/media_detail.h>
|
||||
|
||||
bool os::media::IsExternalMediaPlaying()
|
||||
{
|
||||
return detail::IsExternalMediaPlaying();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::media::detail
|
||||
{
|
||||
bool IsExternalMediaPlaying();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#include <os/process.h>
|
||||
#include <os/process_detail.h>
|
||||
|
||||
std::filesystem::path os::process::GetExecutablePath()
|
||||
{
|
||||
return detail::GetExecutablePath();
|
||||
}
|
||||
|
||||
std::filesystem::path os::process::GetWorkingDirectory()
|
||||
{
|
||||
return detail::GetWorkingDirectory();
|
||||
}
|
||||
|
||||
bool os::process::StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work)
|
||||
{
|
||||
return detail::StartProcess(path, args, work);
|
||||
}
|
||||
@@ -4,5 +4,5 @@ namespace os::process
|
||||
{
|
||||
std::filesystem::path GetExecutablePath();
|
||||
std::filesystem::path GetWorkingDirectory();
|
||||
bool StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work = {});
|
||||
bool StartProcess(const std::filesystem::path& path, const std::vector<std::string>& args, std::filesystem::path work = {});
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::process::detail
|
||||
{
|
||||
std::filesystem::path GetExecutablePath();
|
||||
std::filesystem::path GetWorkingDirectory();
|
||||
bool StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work = {});
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <os/user.h>
|
||||
#include <os/user_detail.h>
|
||||
|
||||
bool os::user::IsDarkTheme()
|
||||
{
|
||||
return detail::IsDarkTheme();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::user::detail
|
||||
{
|
||||
bool IsDarkTheme();
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <os/version.h>
|
||||
#include <os/version_detail.h>
|
||||
|
||||
os::version::detail::OSVersion os::version::GetOSVersion()
|
||||
{
|
||||
return detail::GetOSVersion();
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <os/version_detail.h>
|
||||
|
||||
namespace os::version
|
||||
{
|
||||
detail::OSVersion GetOSVersion();
|
||||
struct OSVersion
|
||||
{
|
||||
uint32_t Major{};
|
||||
uint32_t Minor{};
|
||||
uint32_t Build{};
|
||||
};
|
||||
|
||||
OSVersion GetOSVersion();
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::version::detail
|
||||
{
|
||||
struct OSVersion
|
||||
{
|
||||
uint32_t Major{};
|
||||
uint32_t Minor{};
|
||||
uint32_t Build{};
|
||||
};
|
||||
|
||||
OSVersion GetOSVersion();
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
#include <os/logger_detail.h>
|
||||
#include <print>
|
||||
#include <os/logger.h>
|
||||
|
||||
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
|
||||
#define FOREGROUND_YELLOW (FOREGROUND_RED | FOREGROUND_GREEN)
|
||||
|
||||
HANDLE g_hStandardOutput;
|
||||
|
||||
void os::logger::detail::Init()
|
||||
void os::logger::Init()
|
||||
{
|
||||
g_hStandardOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
}
|
||||
|
||||
void os::logger::detail::Log(const std::string_view str, detail::ELogType type, const char* func)
|
||||
void os::logger::Log(const std::string_view str, ELogType type, const char* func)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <os/media_detail.h>
|
||||
#include <os/media.h>
|
||||
#include <os/logger.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Media.Control.h>
|
||||
@@ -62,7 +62,7 @@ static GlobalSystemMediaTransportControlsSessionPlaybackInfo GetPlaybackInfo()
|
||||
}
|
||||
}
|
||||
|
||||
bool os::media::detail::IsExternalMediaPlaying()
|
||||
bool os::media::IsExternalMediaPlaying()
|
||||
{
|
||||
auto playbackInfo = GetPlaybackInfo();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <os/process_detail.h>
|
||||
#include <os/process.h>
|
||||
|
||||
std::filesystem::path os::process::detail::GetExecutablePath()
|
||||
std::filesystem::path os::process::GetExecutablePath()
|
||||
{
|
||||
WCHAR exePath[MAX_PATH];
|
||||
|
||||
@@ -10,7 +10,7 @@ std::filesystem::path os::process::detail::GetExecutablePath()
|
||||
return std::filesystem::path(exePath);
|
||||
}
|
||||
|
||||
std::filesystem::path os::process::detail::GetWorkingDirectory()
|
||||
std::filesystem::path os::process::GetWorkingDirectory()
|
||||
{
|
||||
WCHAR workPath[MAX_PATH];
|
||||
|
||||
@@ -20,7 +20,7 @@ std::filesystem::path os::process::detail::GetWorkingDirectory()
|
||||
return std::filesystem::path(workPath);
|
||||
}
|
||||
|
||||
bool os::process::detail::StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work)
|
||||
bool os::process::StartProcess(const std::filesystem::path& path, const std::vector<std::string>& args, std::filesystem::path work)
|
||||
{
|
||||
if (path.empty())
|
||||
return false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <os/user_detail.h>
|
||||
#include <os/user.h>
|
||||
|
||||
bool os::user::detail::IsDarkTheme()
|
||||
bool os::user::IsDarkTheme()
|
||||
{
|
||||
HKEY hKey;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include <os/version_detail.h>
|
||||
#include <os/version.h>
|
||||
|
||||
LIB_FUNCTION(LONG, "ntdll.dll", RtlGetVersion, PRTL_OSVERSIONINFOW);
|
||||
|
||||
os::version::detail::OSVersion os::version::detail::GetOSVersion()
|
||||
os::version::OSVersion os::version::GetOSVersion()
|
||||
{
|
||||
auto result = os::version::detail::OSVersion{};
|
||||
auto result = os::version::OSVersion{};
|
||||
|
||||
OSVERSIONINFOEXW osvi = { 0 };
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
|
||||
|
||||
Reference in New Issue
Block a user