Ookii.CommandLine for C++
1.0.0
|
Output stream that wraps lines on white-space characters at the specified line length, and with support for indentation. More...
#include <ookii/line_wrapping_stream.h>
Public Types | |
using | base_type = std::basic_ostream< CharType, Traits > |
The concrete type that this class derives from. | |
using | streambuf_type = std::basic_streambuf< CharType, Traits > |
The concrete base stream buffer type used by this stream. | |
Public Member Functions | |
basic_line_wrapping_ostream (base_type &base_stream, size_t max_line_length) | |
Initializes a new instance of the basic_line_wrapping_ostream class with the specified underlying stream and maximum line length. More... | |
basic_line_wrapping_ostream (basic_line_wrapping_ostream &&other) noexcept | |
Move constructor. More... | |
basic_line_wrapping_ostream & | operator= (basic_line_wrapping_ostream &&other) noexcept |
Move assignment operator. More... | |
void | swap (basic_line_wrapping_ostream &other) noexcept |
Swaps this basic_line_wrapping_ostream instance with another. More... | |
Static Public Member Functions | |
static basic_line_wrapping_ostream | for_cerr (short default_width=80) |
Creates a basic_line_wrapping_ostream that writes to the standard error stream, using the console width as the line width. More... | |
static basic_line_wrapping_ostream | for_cout (short default_width=80) |
Creates a basic_line_wrapping_ostream that writes to the standard output stream, using the console width as the line width. More... | |
Output stream that wraps lines on white-space characters at the specified line length, and with support for indentation.
This stream writes its output to the stream buffer of another stream, which could be any stream (like a file stream, or string stream).
Several typedefs for common character types are provided:
Type | Definition |
---|---|
ookii::line_wrapping_ostream | ookii::basic_line_wrapping_ostream<char> |
ookii::wline_wrapping_ostream | ookii::basic_line_wrapping_ostream<wchar_t> |
CharType | The type of characters used by the target stream. |
Traits | The character traits used by the target stream. |
|
inline |
Initializes a new instance of the basic_line_wrapping_ostream class with the specified underlying stream and maximum line length.
base_stream | The stream whose stream buffer to write output to. |
max_line_length | The maximum line length, or a value of 0 or larger than 65536 to specify no limit. Use the use_console_width constant to use the console width as the maximum. |
|
inlinenoexcept |
Move constructor.
other | The basic_line_wrapping_ostream to move from. |
|
inlinestatic |
Creates a basic_line_wrapping_ostream that writes to the standard error stream, using the console width as the line width.
default_width | The maximum line length to use if the console width cannot be determined. |
|
inlinestatic |
Creates a basic_line_wrapping_ostream that writes to the standard output stream, using the console width as the line width.
default_width | The maximum line length to use if the console width cannot be determined. |
|
inlinenoexcept |
Move assignment operator.
other | The basic_line_wrapping_ostream to move from. |
|
inlinenoexcept |
Swaps this basic_line_wrapping_ostream instance with another.
other | The instance to swap with. |