| 4118 | #endif |
| 4119 | |
| 4120 | struct TextAttributes { |
| 4121 | TextAttributes() |
| 4122 | : initialIndent( std::string::npos ), |
| 4123 | indent( 0 ), |
| 4124 | width( consoleWidth-1 ), |
| 4125 | tabChar( '\t' ) |
| 4126 | {} |
| 4127 | |
| 4128 | TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } |
| 4129 | TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } |
| 4130 | TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } |
| 4131 | TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } |
| 4132 | |
| 4133 | std::size_t initialIndent; // indent of first line, or npos |
| 4134 | std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos |
| 4135 | std::size_t width; // maximum width of text, including indent. Longer text will wrap |
| 4136 | char tabChar; // If this char is seen the indent is changed to current pos |
| 4137 | }; |
| 4138 | |
| 4139 | class Text { |
| 4140 | public: |
no outgoing calls