AuroraRuntime/Include/Aurora/Console/Console.hpp
Reece 45975e4755 [+] Added console stdin loop source
[*] Fix logger color regression
[*] Fix various issues with console config struct
2022-05-03 07:19:26 +01:00

84 lines
2.5 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Console.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
#include "EAnsiColor.hpp"
#include "ConsoleMessage.hpp"
namespace Aurora::Logging
{
struct ILogger;
}
namespace Aurora::Loop
{
struct ILoopSource;
}
namespace Aurora::Console
{
/**
* @brief Returns the untouched ILogger interface of the AuLogXX functions as configured by the Aurora::RuntimeStartInfo structure
* @return
*/
AUKN_SYM AuSPtr<Logging::ILogger> GetDefaultLogInterface();
/**
* @brief Asynchronous binary read of the underlying stream, unlocalized and potentially being consumed by other users.
* Consider using `Hooks::SetCallbackAndDisableCmdProcessing` for asynchronous utf-8 processed line based input
* @param buffer
* @param length
* @return
*/
AUKN_SYM AuUInt32 ReadStdIn(void *buffer, AuUInt32 length);
/**
* @brief Asynchronous binary write to the applications stdout stream. Consider using `AuLogInfo` for general purpose messaging
* @param buffer
* @param length
* @return
*/
AUKN_SYM AuUInt32 WriteStdOut(const void *buffer, AuUInt32 length);
/**
* @brief Simulates an input line from an internal console interface given a UTF-8 string
* Populates ReadStdIn and notifys the hook callback
* @param string
* @return
*/
AUKN_SYM bool DispatchRawLine(const AuString &string);
AUKN_SYM AuSPtr<Loop::ILoopSource> StdInBufferLoopSource();
AUKN_SYM AuUInt32 TTYWrite(const void *buffer, AuUInt32 length);
AUKN_SYM void TTYWrite(const char *string, EAnsiColor fgColor = EAnsiColor::eEnumCount, EAnsiColor bgColor = EAnsiColor::eEnumCount);
AUKN_SYM void TTYFill(char character, EAnsiColor fgColor = EAnsiColor::eEnumCount, EAnsiColor bgColor = EAnsiColor::eEnumCount);
AUKN_SYM void TTYClearLine(EAnsiColor bgColor = EAnsiColor::eEnumCount);
AUKN_SYM void TTYClearScreen();
AUKN_SYM AuPair<AuUInt32, AuUInt32> TTYScreenSize();
AUKN_SYM void TTYSetPos(AuPair<AuUInt32, AuUInt32> position);
AUKN_SYM void TTYStorePos();
AUKN_SYM void TTYRestorePos();
AUKN_SYM void TTYMoveY(AuInt16 lines);
AUKN_SYM void TTYMoveX(AuInt16 cols);
AUKN_SYM void TTYSetY(AuUInt16 Y);
AUKN_SYM void TTYSetX(AuUInt16 X);
AUKN_SYM void TTYReturnHome();
AUKN_SYM void OpenLateStd();
AUKN_SYM void OpenLateGUI();
}
#include "Commands/Commands.hpp"
#include "Hooks/Hooks.hpp"