#include <stream_util.hpp>
RAII helper class to make formatting modifications to a stream and ensure those modifications are reset upon destruction.
- Author
- Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
- Version
- January 3, 2021
◆ ScopedStreamModifiers()
fly::detail::ScopedStreamModifiers::ScopedStreamModifiers |
( |
std::ostream & |
stream | ) |
|
|
inlineexplicitnoexcept |
Constructor. Store the stream's current state to be restored upon destruction.
- Parameters
-
stream | The stream to be modified. |
◆ ~ScopedStreamModifiers()
fly::detail::ScopedStreamModifiers::~ScopedStreamModifiers |
( |
| ) |
|
|
inline |
Destructor. Restore the stream's orginal state.
◆ fill()
void fly::detail::ScopedStreamModifiers::fill |
( |
char |
ch | ) |
|
|
inline |
Set the fill character of the stream.
- Parameters
-
◆ locale()
template<typename Facet >
void fly::detail::ScopedStreamModifiers::locale |
|
inline |
Imbue a new locale onto the stream with a specific facet.
- Template Parameters
-
Facet | The type of facet to imbue. |
◆ precision()
void fly::detail::ScopedStreamModifiers::precision |
( |
std::streamsize |
size | ) |
|
|
inline |
Set the precision of the stream.
- Parameters
-
size | The new precision setting. |
◆ setf() [1/2]
void fly::detail::ScopedStreamModifiers::setf |
( |
std::ios_base::fmtflags |
flag | ) |
|
|
inline |
Sets a formatting flag on the stream.
- Parameters
-
flag | The new formatting setting. |
◆ setf() [2/2]
void fly::detail::ScopedStreamModifiers::setf |
( |
std::ios_base::fmtflags |
flag, |
|
|
std::ios_base::fmtflags |
mask |
|
) |
| |
|
inline |
Clears a mask of formatting flags on the stream and sets a specific flag.
- Parameters
-
flag | The new formatting setting. |
mask | The formatting mask to clear. |
◆ width()
void fly::detail::ScopedStreamModifiers::width |
( |
std::streamsize |
size | ) |
|
|
inline |
Set the width of the stream.
- Parameters
-
size | The new width setting. |
The documentation for this class was generated from the following file: