summaryrefslogtreecommitdiffhomepage
path: root/KernelKit/DebugOutput.hpp
blob: 3bfb0144611318b02c389d055133b3163af0b489 (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 2024 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 IDevice<const char*>
    {
    public:
        TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : IDevice<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