blob: a651cb8bef394c911be0259647904d60a27135cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* ========================================================
*
* HCore
* Copyright Mahrouss Logic, all rights reserved.
*
* ========================================================
*/
#pragma once
#include <KernelKit/Device.hpp>
#include <NewKit/OwnPtr.hpp>
#include <NewKit/Stream.hpp>
namespace HCore
{
// @brief Emulates a VT100 terminal.
class TerminalDevice final : public DeviceInterface<const char*>
{
public:
TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : DeviceInterface<const char*>(print, get) {}
virtual ~TerminalDevice() {}
/// @brief returns device name (terminal name)
/// @return string type (const char*)
virtual const char* Name() const override { return ("TerminalDevice"); }
TerminalDevice &operator=(const TerminalDevice &) = default;
TerminalDevice(const TerminalDevice &) = default;
};
namespace Detail
{
bool serial_init();
}
extern TerminalDevice kcout;
} // namespace HCore
|