|
libzypp
17.37.18
|
Write MBString optionally wrapped and indented. More...
#include <zypp-tui/utils/text.h>
Classes | |
| struct | ScopedIndentIncrement |
| Temporarily increase indent. More... | |
Public Member Functions | |
| MbsWriteWrapped (std::ostream &out) | |
| MbsWriteWrapped (std::ostream &out, size_t wrap_r) | |
| MbsWriteWrapped (std::ostream &out, size_t indent_r, size_t wrap_r, int indentFix_r=0) | |
| size_t | defaultWrap () const |
| size_t | defaultIndent () const |
| int | defaultIndentFix () const |
| size_t | indent () const |
| size_t | lpos () const |
| bool | atLineBegin () const |
| bool | atParBegin () const |
| void | resetToParBegin () |
| Reset housekeeping data to the beginning of a paragraph (does not write anything) More... | |
| void | gotoNextPar () |
| Write out any pending word and start a new par (NL unconditionally) More... | |
| void | gotoParBegin () |
| Open a new paragraph if not atParBegin. More... | |
| void | gotoNextLine (size_t count_r=1) |
| Add count_r (1) new lines in this par (BR unconditionally) More... | |
| void | gotoLineBegin () |
| Open a new line in this paragraph if not atLineBegin. More... | |
| void | startPar (boost::string_ref text_r) |
| Write text_r; starting a new paragraph. More... | |
| void | startPar (boost::string_ref text_r, size_t increment_r) |
| void | addString (boost::string_ref text_r) |
| Continue writing text at the current position. More... | |
| void | addString (boost::string_ref text_r, size_t increment_r) |
| void | writeText (boost::string_ref text_r) |
| Continue writing text (separated by WS if not atLineBegin). More... | |
| void | writeText (boost::string_ref text_r, size_t increment_r) |
| void | writePar (boost::string_ref text_r) |
| Write text_r; starting a new paragraph and ending it after the text was written. More... | |
| void | writePar (boost::string_ref text_r, size_t increment_r) |
| void | writeDefinition (boost::string_ref tag_r, boost::string_ref text_r, size_t tagincr_r, size_t textincr_r) |
| Write a tag_r with indented definition text_r. More... | |
| void | writeDefinition (boost::string_ref tag_r, boost::string_ref text_r) |
| void | writeDefinition (boost::string_ref tag_r, boost::string_ref text_r, size_t tagincr_r, size_t textincr_r, size_t increment_r) |
| void | writeDefinition (boost::string_ref tag_r, boost::string_ref text_r, size_t increment_r) |
Private Member Functions | |
| void | write (boost::string_ref text_r, bool leadingWSindents_r=true) |
| Append text_r indented and wrapped at the current position. More... | |
| void | writeout (bool force_r=false) |
| Write any pending "indent/gap+word" and reset for next word. More... | |
| void | _writeoutPending () |
| size_t | fixIndent (size_t indent_r) |
| Return fixed indent_r (unsets _indentFix) More... | |
| size_t | saneIncrementIndent (size_t increment_r) |
Return incremented _indent, but not more than 50% of the remaining line size if wrapped. More... | |
| void | clearIndent () |
Set default indent at par start (reloads _indentFix) More... | |
| void | clearGap () |
| Set no gaps. More... | |
| void | clearWord () |
| Set no word pending. More... | |
Static Private Member Functions | |
| static size_t | fixIndent (size_t indent_r, int indentFix_r) |
| Return fixed indent_r. More... | |
| static size_t | saneIncrementIndent (size_t current_r, size_t increment_r, size_t wrap_r) |
| Return incremented indent, but not to more than 50% of the remaining line size if wrapped. More... | |
Private Attributes | |
| std::ostream & | _out |
| const size_t | _defaultWrap |
| const size_t | _defaultIndent |
| const int | _defaultIndentFix |
| size_t | _indent |
| int | _indentFix |
| size_t | _indentGap |
| size_t | _lpos |
| size_t | _gap |
| size_t | _gapForced |
| size_t | _gapLines |
| const char * | _word |
| size_t | _wSize |
| size_t | _wColumns |
Related Functions | |
(Note that these are not member functions.) | |
| ScopedIndentIncrement | scopedIndentIncrement (size_t increment_r) |
Write MBString optionally wrapped and indented.
The class assumes the output starts at the beginning of a new term line. Every '
' in text starts a new paragraph (on an new line with default indent).
WS at par begin increments indent for this par.
Use gotoNextLine to open a new indented line without stating a new par.
If MbsWriteWrapped is used in conjunction with plain screen output, you can use resetToParBegin to reset housekeeping data after plain screen output.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Open a new paragraph if not atParBegin.
|
inline |
|
inline |
Open a new line in this paragraph if not atLineBegin.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Continue writing text (separated by WS if not atLineBegin).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
related |
|
private |
|
private |
|
private |