#include <gromacs/utility/stringutil.h>
Stores settings for line wrapping.
Methods in this class do not throw.
- See Also
- TextLineWrapper
gmx::TextLineWrapperSettings::TextLineWrapperSettings |
( |
| ) |
|
Initializes default wrapper settings.
Default settings are:
- No maximum line width (only explicit line breaks).
- No indentation.
- No continuation characters.
- Ignore whitespace after an explicit newline.
int gmx::TextLineWrapperSettings::firstLineIndent |
( |
| ) |
const |
|
inline |
void gmx::TextLineWrapperSettings::setContinuationChar |
( |
char |
continuationChar | ) |
|
|
inline |
Sets a continuation marker for wrapped lines.
- Parameters
-
[in] | continuationChar | Character to use to mark continuation lines. |
If set to non-zero character code, this character is added at the end of each line where a line break is added by TextLineWrapper (but not after lines produced by explicit line breaks). The default ('\0'
) is to not add continuation markers.
Note that currently, the continuation char may cause the output line length to exceed the value set with setLineLength() by at most two characters.
void gmx::TextLineWrapperSettings::setFirstLineIndent |
( |
int |
indent | ) |
|
|
inline |
Sets the indentation for first output line after a line break.
- Parameters
-
[in] | indent | Number of spaces to add for indentation. |
If this method is not called, or called with indent
equal to -1, the value set with setIndent() is used.
void gmx::TextLineWrapperSettings::setIndent |
( |
int |
indent | ) |
|
|
inline |
Sets the indentation for output lines.
- Parameters
-
[in] | indent | Number of spaces to add for indentation. |
If this method is not called, the wrapper does not add indentation.
void gmx::TextLineWrapperSettings::setLineLength |
( |
int |
length | ) |
|
|
inline |
Sets the maximum length for output lines.
- Parameters
-
[in] | length | Maximum length for the lines after wrapping. |
If this method is not called, or is called with zero length
, the wrapper has no maximum length (only wraps at explicit line breaks).
void gmx::TextLineWrapperSettings::setStripLeadingWhitespace |
( |
bool |
bStrip | ) |
|
|
inline |
Sets whether to remove spaces after an explicit newline.
- Parameters
-
[in] | bStrip | If true, spaces after newline are ignored. |
If not removed, the space is added to the indentation set with setIndent(). The default is to not strip such whitespace.
The documentation for this class was generated from the following files:
- src/gromacs/utility/stringutil.h
- src/gromacs/utility/stringutil.cpp