See previous commit
This commit is contained in:
36
Common/IO.h
36
Common/IO.h
@@ -11,30 +11,30 @@ namespace LXC::Util
|
||||
// Enum to translate to the Win32 code for the colors //
|
||||
enum Color : WORD
|
||||
{
|
||||
DEFAULT = 0x07,
|
||||
DEFAULT = 0x07,
|
||||
|
||||
BLACK = 0x00,
|
||||
BLUE = 0x01,
|
||||
GREEN = 0x02,
|
||||
AQUA = 0x03,
|
||||
RED = 0x04,
|
||||
PURPLE = 0x05,
|
||||
YELLOW = 0x06,
|
||||
LIGHT_GRAY = 0x07,
|
||||
LIGHT_BLUE = 0x09,
|
||||
LIGHT_GREEN = 0x0a,
|
||||
LIGHT_AQUA = 0x0b,
|
||||
LIGHT_RED = 0x0c,
|
||||
LIGHT_PURPLE = 0x0d,
|
||||
LIGHT_YELLOW = 0x0e,
|
||||
WHITE = 0x0f
|
||||
BLACK = 0x00,
|
||||
BLUE = 0x01,
|
||||
GREEN = 0x02,
|
||||
AQUA = 0x03,
|
||||
RED = 0x04,
|
||||
PURPLE = 0x05,
|
||||
YELLOW = 0x06,
|
||||
LIGHT_GRAY = 0x07,
|
||||
LIGHT_BLUE = 0x09,
|
||||
LIGHT_GREEN = 0x0a,
|
||||
LIGHT_AQUA = 0x0b,
|
||||
LIGHT_RED = 0x0c,
|
||||
LIGHT_PURPLE = 0x0d,
|
||||
LIGHT_YELLOW = 0x0e,
|
||||
WHITE = 0x0f
|
||||
};
|
||||
}
|
||||
|
||||
namespace LXC::Internal
|
||||
{
|
||||
// Checks if a type can be outputted to std::ostream //
|
||||
template<typename T> concept Logable = requires(std::ostream& os, T t)
|
||||
template<typename T> concept Logable = requires(std::ostream & os, T t)
|
||||
{
|
||||
// I have no idea what this part does at all //
|
||||
{ os << t } -> std::same_as<std::ostream&>;
|
||||
@@ -62,7 +62,7 @@ namespace LXC::Internal
|
||||
inline void WriteImpl(std::ostream& os, Args&&... args)
|
||||
{
|
||||
static HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if constexpr(col != Util::Color::DEFAULT)
|
||||
if constexpr (col != Util::Color::DEFAULT)
|
||||
SetConsoleTextAttribute(hConsole, static_cast<WORD>(col));
|
||||
|
||||
(os << ... << std::forward<Args>(args));
|
||||
|
||||
Reference in New Issue
Block a user