diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-01-16 13:36:38 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-01-16 13:36:38 +0100 |
| commit | 7d6f0ed063790042a808f4bf07c50d308b3f2de4 (patch) | |
| tree | 1a2e1c4ed7e2f3d8e6cdcfb012e554d1a4eb1e5a /kernel/src/kapi/cio.cpp | |
| parent | 9750405757396d006ab6992fb93baf414b3e2ae8 (diff) | |
| download | teachos-7d6f0ed063790042a808f4bf07c50d308b3f2de4.tar.xz teachos-7d6f0ed063790042a808f4bf07c50d308b3f2de4.zip | |
chore: restructure namespaces
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 |
