ROSE 0.11.145.147
|
A class that can reflow and indent paragraphs.
This class acts as an input stream in that it processes calls to its function operator to accumulate text. The accumulated text is indented according to the current indentation level, and reflowed so that it fills the current page width. Isolated linefeeds are ignored, and consecutive linefeeds (no matter how many) result in a single blank line in the output.
Definition at line 327 of file DocumentMarkup.h.
#include <Sawyer/DocumentMarkup.h>
Public Member Functions | |
Reflow (size_t pageWidth=80) | |
Construct a reflow filter. | |
Reflow & | lineBreak () |
Insert a line break. | |
Reflow & | operator() (const std::string &s) |
Insert text. | |
std::string | toString () |
Extract the reflowed string. | |
size_t | pageWidth () const |
Property: Page width. | |
Reflow & | pageWidth (size_t n) |
Property: Page width. | |
const std::string & | indentationString () const |
Property: Indentation string. | |
Reflow & | indentationString (const std::string &s) |
Property: Indentation string. | |
Reflow & | operator++ () |
Increase or decrease indentation. | |
Reflow & | operator-- () |
Increase or decrease indentation. | |
|
inlineexplicit |
Construct a reflow filter.
This reflow filter will use the specified page width, measured in characters.
Definition at line 341 of file DocumentMarkup.h.
|
inline |
Property: Page width.
The page width is usually set in the constructor, but it can also be modified through this property. Modifying the page width during operation is allowed, but will only affect data streamed in after the change. A minimum page width of 20 columns is enforced.
Definition at line 351 of file DocumentMarkup.h.
|
inline |
Property: Page width.
The page width is usually set in the constructor, but it can also be modified through this property. Modifying the page width during operation is allowed, but will only affect data streamed in after the change. A minimum page width of 20 columns is enforced.
Definition at line 352 of file DocumentMarkup.h.
|
inline |
Property: Indentation string.
This is the string emitted for each level of indentation. The default is four spaces. TAB characters should be avoided since they may interfere with column calculations.
Definition at line 361 of file DocumentMarkup.h.
|
inline |
Property: Indentation string.
This is the string emitted for each level of indentation. The default is four spaces. TAB characters should be avoided since they may interfere with column calculations.
Definition at line 362 of file DocumentMarkup.h.
Reflow & Sawyer::Document::Markup::Reflow::operator++ | ( | ) |
Increase or decrease indentation.
Indentation is always increased or decreased one level at a time. The indentation level will never go below zero.
If the indentation is changed in the middle of a line it will affect only subsequent lines.
Reflow & Sawyer::Document::Markup::Reflow::operator-- | ( | ) |
Increase or decrease indentation.
Indentation is always increased or decreased one level at a time. The indentation level will never go below zero.
If the indentation is changed in the middle of a line it will affect only subsequent lines.
Reflow & Sawyer::Document::Markup::Reflow::lineBreak | ( | ) |
Insert a line break.
A line break causes subsequent input to appear on the next line. Inserting multiple line breaks and/or paragraph separators (two or more consecutive linefeeds) does not produce extra blank lines in the output.
Reflow & Sawyer::Document::Markup::Reflow::operator() | ( | const std::string & | s | ) |
Insert text.
The specified string is inserted into the reflow engine.
std::string Sawyer::Document::Markup::Reflow::toString | ( | ) |
Extract the reflowed string.
Returns the text that has been inserted so far.