Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
gmx::TextTableFormatter::Impl::ColumnData Struct Reference

Description

Manages a single column for TextTableFormatter.

Public Member Functions

 ColumnData (const char *title, int width, bool bWrap)
 Initializes a text table column with given values.
 
const std::string & title () const
 Returns the title of the column.
 
int width () const
 Returns the width of the column.
 
int firstLine () const
 Returns the first line offset for the current row. More...
 
void startFormatting ()
 Resets the formatting state. More...
 
bool hasLinesRemaining () const
 Whether there are lines remaining for textForNextLine().
 
std::string textForNextLine (int columnWidth)
 Returns the text for the next line. More...
 

Public Attributes

std::string title_
 Statit data: title of the column.
 
int width_
 Static data: width of the column.
 
bool bWrap_
 Static data: whether to automatically wrap input text.
 
int firstLine_
 First line offset for the current row.
 
std::vector< std::string > lines_
 Text lines for the current row.
 
int nextLineIndex_
 Formatting state: index in lines_ for the next line.
 
size_t nextLineOffset_
 Formatting state: offset within line nextLineIndex_ for the next line.
 

Member Function Documentation

int gmx::TextTableFormatter::Impl::ColumnData::firstLine ( ) const
inline

Returns the first line offset for the current row.

Note that the return value may be outside the printed lines if there is no text.

void gmx::TextTableFormatter::Impl::ColumnData::startFormatting ( )
inline

Resets the formatting state.

After this call, textForNextLine() and hasLinesRemaining() can be used to format the lines for the column.

std::string gmx::TextTableFormatter::Impl::ColumnData::textForNextLine ( int  columnWidth)
inline

Returns the text for the next line.

Parameters
[in]columnWidthWidth to wrap the text to.
Returns
Text for the next line, or empty string if there is no text for this column.

The documentation for this struct was generated from the following file: