From 8499b101e3a9cf320cb6d706a278914e439ca641 Mon Sep 17 00:00:00 2001 From: Madeline Busig Date: Mon, 25 Mar 2024 21:17:03 -0600 Subject: [PATCH] Add string_stream pipe modifiers --- include/mtl/stream.cpp | 14 ++++++++++++++ include/mtl/stream.hpp | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 include/mtl/stream.cpp create mode 100644 include/mtl/stream.hpp diff --git a/include/mtl/stream.cpp b/include/mtl/stream.cpp new file mode 100644 index 0000000..7423ec6 --- /dev/null +++ b/include/mtl/stream.cpp @@ -0,0 +1,14 @@ +#include "mtl/stream.hpp" + +namespace mtl { + +_endl endl; +_flush flush; + +_dec dec; +_hex hex; + +_left left; +_right right; + +} // namespace mtl diff --git a/include/mtl/stream.hpp b/include/mtl/stream.hpp new file mode 100644 index 0000000..6ad16d6 --- /dev/null +++ b/include/mtl/stream.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include + +namespace mtl { + +extern struct _endl { } endl; +extern struct _flush { } flush; + +extern struct _dec { } dec; +extern struct _hex { } hex; + +extern struct _left { } left; +extern struct _right { } right; +struct setw { + size_t m_w; + setw(size_t w) : m_w(w) { } +}; + +} // namespace mtl