AuroraRuntime/Include/Aurora/Console/Console.hpp

67 lines
1.8 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::IO::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 Nonblocking 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 Nonblocking 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<IO::Loop::ILoopSource> StdInBufferLoopSource();
AUKN_SYM void OpenLateStd();
AUKN_SYM void OpenLateGUI();
}
#include "ConsoleStd/ConsoleStd.hpp"
#include "ConsoleTTY/ConsoleTTY.hpp"
#include "Commands/Commands.hpp"
#include "Hooks/Hooks.hpp"