All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
OptionParser::PrintUsageImplementation::LineWrapper Class Reference

#include <optionparser.h>

Public Member Functions

void flush (IStringWriter &write)
 Writes out all remaining data from the LineWrapper using write. More...
 
void process (IStringWriter &write, const char *data, int len)
 Process, wrap and output the next piece of data. More...
 
 LineWrapper (int x1, int x2)
 Constructs a LineWrapper that wraps its output to fit into screen columns x1 (incl.) to x2 (excl.). More...
 

Constructor & Destructor Documentation

OptionParser::PrintUsageImplementation::LineWrapper::LineWrapper ( int  x1,
int  x2 
)
inline

Constructs a LineWrapper that wraps its output to fit into screen columns x1 (incl.) to x2 (excl.).

x1 gives the indentation LineWrapper uses if it needs to indent.

Member Function Documentation

void OptionParser::PrintUsageImplementation::LineWrapper::flush ( IStringWriter write)
inline

Writes out all remaining data from the LineWrapper using write.

Unlike process() this method indents all lines including the first and will output a \n at the end (but only if something has been written).

void OptionParser::PrintUsageImplementation::LineWrapper::process ( IStringWriter write,
const char *  data,
int  len 
)
inline

Process, wrap and output the next piece of data.

process() will output at least one line of output. This is not necessarily the data passed in. It may be data queued from a prior call to process(). If the internal buffer is full, more than 1 line will be output.

process() assumes that the a proper amount of indentation has already been output. It won't write any further indentation before the 1st line. If more than 1 line is written due to buffer constraints, the lines following the first will be indented by this method, though.

No \n is written by this method after the last line that is written.

Parameters
writewhere to write the data.
datathe new chunk of data to write.
lenthe length of the chunk of data to write.

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