blob: 235163ac1c8b94893b0c7747bd6a741d96baded7 (
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
41
42
43
44
|
/*
* ========================================================
*
* HCore
* Copyright Mahrouss Logic, all rights reserved.
*
* ========================================================
*/
#pragma once
#include <KernelKit/DeviceManager.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;
static TerminalDevice Shared() noexcept;
};
namespace Detail {
bool serial_init();
}
} // namespace HCore
#ifdef kcout
#undef kcout
#endif // ifdef kcout
#define kcout TerminalDevice::Shared()
|