diff options
Diffstat (limited to 'kernel/src/kapi/cio.cpp')
| -rw-r--r-- | kernel/src/kapi/cio.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/kernel/src/kapi/cio.cpp b/kernel/src/kapi/cio.cpp deleted file mode 100644 index 01c6420..0000000 --- a/kernel/src/kapi/cio.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "kapi/cio.hpp" - -#include <optional> -#include <string_view> -#include <utility> - -namespace teachos::cio -{ - namespace - { - struct null_device final : public output_device - { - null_device static instance; - auto write(output_stream, std::string_view) -> void override {} - }; - - constinit null_device null_device::instance; - } // namespace - - constinit auto static active_device = static_cast<output_device *>(&null_device::instance); - - auto set_output_device(output_device & device) -> std::optional<output_device *> - { - if (&device == active_device) - { - return {}; - } - return std::exchange(active_device, &device); - } - - auto write(output_stream stream, std::string_view text) -> void - { - active_device->write(stream, text); - } - -} // namespace teachos::cio |
