OpenMS  2.7.0
Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ConsoleUtils Class Reference

#include <OpenMS/APPLICATIONS/ConsoleUtils.h>

Collaboration diagram for ConsoleUtils:
[legend]

Static Public Member Functions

static String breakString (const String &input, const Size indentation, const Size max_lines)
 

Private Member Functions

int readConsoleSize_ ()
 read console settings for output shaping More...
 
String breakString_ (const String &input, const Size indentation, const Size max_lines)
 returns a console friendly version of input More...
 
 ConsoleUtils ()
 C'tor. More...
 
 ConsoleUtils (const ConsoleUtils &)
 Copy C'tor. More...
 
void operator= (ConsoleUtils const &)
 Assignment operator. More...
 

Private Attributes

int console_width_
 width of console we are currently in (if not determinable, set to 80 as default) More...
 

Constructor & Destructor Documentation

◆ ConsoleUtils() [1/2]

ConsoleUtils ( )
private

C'tor.

◆ ConsoleUtils() [2/2]

ConsoleUtils ( const ConsoleUtils )
private

Copy C'tor.

Member Function Documentation

◆ breakString()

static String breakString ( const String input,
const Size  indentation,
const Size  max_lines 
)
static

make a string console friendly by breaking it into multiple lines according to the console width The 'indentation' gives the number of spaces which is prepended beginning at the second (!) line, so one gets a left aligned block which has some space to the left. An indentation of 0 results in the native console's default behaviour: just break at the end of its width and start a new line. but usually one wants nicely intended blocks, which the console does not support 'max_lines' gives the upper limit of lines returned after breaking is finished. Excess lines are removed and replaced by '...', BUT the last line will be preserved.

Parameters
inputString to be split
indentationNumber of spaces to use for lines 2 until last line.
max_linesLimit of output lines (all others are removed)

◆ breakString_()

String breakString_ ( const String input,
const Size  indentation,
const Size  max_lines 
)
private

returns a console friendly version of input

◆ operator=()

void operator= ( ConsoleUtils const &  )
private

Assignment operator.

◆ readConsoleSize_()

int readConsoleSize_ ( )
private

read console settings for output shaping

Member Data Documentation

◆ console_width_

int console_width_
private

width of console we are currently in (if not determinable, set to 80 as default)