EPAM B2BITS C++ Bovespa MarketData handler  1.28.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Static Public Member Functions | List of all members
B2bits::Console Class Reference

Console manipulations More...

#include <b2bits/core/Console.h>

Classes

struct  color
 color manipulator change color for the next << operations More...
 
struct  endl
 endl manipulator - replacement for std::endl More...
 
struct  flush
 flush manipulator - replacement for std::flush More...
 
struct  setw
 width manipulator More...
 

Static Public Member Functions

static void init ()
 initializes the console More...
 
static void destroy ()
 destroys the console More...
 
static void showCursor (bool show=true)
 show/hide cursor More...
 
static void hideCursor ()
 hide cursor from the screen More...
 
static void moveCursor (int x, int y)
 move cursor to the (x,y) position More...
 
static void getCursor (int &x, int &y)
 get current cursor position More...
 
static void getMaxxy (int &x, int &y)
 get max values for cursor position coordinates More...
 
static void cleanupToBottom ()
 clear screen from current line to the bottom More...
 
static void clrscr ()
 clear screen More...
 
static int waitChar ()
 wait for user unput More...
 
static int getChar (bool wait)
 get user input More...
 
static std::ostream & cout ()
 replacement for std::cout More...
 
static std::istream & cin ()
 replacement for std::cin More...
 
static bool showMenu (const char *items[], int num_items, int &choice)
 show user menu in current position More...
 
template<int num_items>
static bool showMenu (const char *(&items)[num_items], int &choice)
 
template<typename T >
static void showList (const T &cont, const std::string &head, bool showLineNumbers)
 show scrollable list of items More...
 

Static Public Attributes

Basic colors support
static const int CLR_BLACK_ON_WHITE
 
static const int CLR_WHITE_ON_BLACK
 
static const int CLR_RED_ON_BLACK
 
static const int CLR_GREEN_ON_BLACK
 
static const int CLR_BLUE_ON_BLACK
 
Basic key codes
static const int key_ESC
 
static const int key_CR
 
static const int key_DOWN
 
static const int key_UP
 
static const int key_LEFT
 
static const int key_RIGHT
 
static const int key_PAGEUP
 
static const int key_PAGEDN
 
static const int key_F1
 
static const int key_F2
 
static const int key_F3
 
static const int key_F4
 
static const int key_F5
 
static const int key_F6
 
static const int key_F7
 
static const int key_F8
 
static const int key_F9
 
static const int key_F10
 
static const int key_F11
 
static const int key_F12
 

Detailed Description

Console manipulations

Helper class for console manipulations, for debug or demo purposes only

Member Function Documentation

static std::istream& B2bits::Console::cin ( )
static

replacement for std::cin

static void B2bits::Console::cleanupToBottom ( )
static

clear screen from current line to the bottom

static void B2bits::Console::clrscr ( )
static

clear screen

static std::ostream& B2bits::Console::cout ( )
static

replacement for std::cout

static void B2bits::Console::destroy ( )
static

destroys the console

static int B2bits::Console::getChar ( bool  wait)
static

get user input

Parameters
waitwhen set to true getchar=waitchar
static void B2bits::Console::getCursor ( int &  x,
int &  y 
)
static

get current cursor position

Parameters
[out]xX screen coordinate
[out]yY screen coordinate
static void B2bits::Console::getMaxxy ( int &  x,
int &  y 
)
static

get max values for cursor position coordinates

Parameters
[out]xmax X screen coordinate
[out]ymax Y screen coordinate
static void B2bits::Console::hideCursor ( )
inlinestatic

hide cursor from the screen

static void B2bits::Console::init ( )
static

initializes the console

static void B2bits::Console::moveCursor ( int  x,
int  y 
)
static

move cursor to the (x,y) position

Parameters
xX screen coordinate
yY screen coordinate
static void B2bits::Console::showCursor ( bool  show = true)
static

show/hide cursor

Parameters
showtrue to show, false to hide
template<typename T >
static void B2bits::Console::showList ( const T &  cont,
const std::string &  head,
bool  showLineNumbers 
)
inlinestatic

show scrollable list of items

Parameters
contcontainer items, must support [] operations
headhead string to display
showLineNumbersshow/hide line numbers
static bool B2bits::Console::showMenu ( const char *  items[],
int  num_items,
int &  choice 
)
static

show user menu in current position

Parameters
itemsmenu items to show
num_itemssize of items
choiceuser choice made
Returns
true if the choice was made
template<int num_items>
static bool B2bits::Console::showMenu ( const char *(&)  items[num_items],
int &  choice 
)
inlinestatic
static int B2bits::Console::waitChar ( )
inlinestatic

wait for user unput

Member Data Documentation

const int B2bits::Console::CLR_BLACK_ON_WHITE
static
const int B2bits::Console::CLR_BLUE_ON_BLACK
static
const int B2bits::Console::CLR_GREEN_ON_BLACK
static
const int B2bits::Console::CLR_RED_ON_BLACK
static
const int B2bits::Console::CLR_WHITE_ON_BLACK
static
const int B2bits::Console::key_CR
static
const int B2bits::Console::key_DOWN
static
const int B2bits::Console::key_ESC
static
const int B2bits::Console::key_F1
static
const int B2bits::Console::key_F10
static
const int B2bits::Console::key_F11
static
const int B2bits::Console::key_F12
static
const int B2bits::Console::key_F2
static
const int B2bits::Console::key_F3
static
const int B2bits::Console::key_F4
static
const int B2bits::Console::key_F5
static
const int B2bits::Console::key_F6
static
const int B2bits::Console::key_F7
static
const int B2bits::Console::key_F8
static
const int B2bits::Console::key_F9
static
const int B2bits::Console::key_LEFT
static
const int B2bits::Console::key_PAGEDN
static
const int B2bits::Console::key_PAGEUP
static
const int B2bits::Console::key_RIGHT
static
const int B2bits::Console::key_UP
static