32 lines
1.0 KiB
C++
32 lines
1.0 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Hooks.hpp
|
|
Date: 2021-6-9
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#include "IConsoleSubscriber.hpp"
|
|
#include "ITextLineSubscriber.hpp"
|
|
|
|
namespace Aurora::Console::Hooks
|
|
{
|
|
AUKN_SYM void AddSubscription(const AuSPtr<IConsoleSubscriber> &subscriber);
|
|
AUKN_SYM void RemoveSubscription(const AuSPtr<IConsoleSubscriber> &subscriber);
|
|
|
|
using LineHook_cb = AuFunction<void(const ConsoleMessage &string)>;
|
|
|
|
/// @deprecated wont ever remove
|
|
/// Most c++ styleguides would have you chuck an IConsoleSubscriber in your app somewhere
|
|
AUKN_SYM void AddFunctionalHook(LineHook_cb hook);
|
|
|
|
|
|
/**
|
|
* Hijacks the UTF-8 input line processor coming from the consoles.
|
|
* Call with an empty interface pointer to reenable command processing
|
|
*
|
|
* Requires AsyncApp or RuntimePump() calls
|
|
*/
|
|
AUKN_SYM void SetCallbackAndDisableCmdProcessing(const AuSPtr<Hooks::ITextLineSubscriber> &subscriber);
|
|
} |