AXCEL C++ Framework
Elegance through abstraction
Public Member Functions | Public Attributes
axcel::console Class Reference

Console I/O and manipulation. More...

#include <axcel.h>

Inheritance diagram for axcel::console:
axcel::io::ios axcel::io::input axcel::io::output axcel::io::iob axcel::io::iob axcel::object axcel::object

List of all members.

Public Member Functions

virtual string type ()
 Get type of object.
virtual operator string ()
 Convert to string.
 console ()
int putc (int c)
 Set destination address.
int getc ()
 Read byte.
int getch ()
 Immediate character input.
int getche ()
 Immediate character input with echo.
bool kbhit ()
 Check for available input.
data dump ()
 Read until EOF.
consoleputcr ()
consoleputbs ()
consolecls ()
consolebel ()
consolesetxy (int x, int y)
consolesetx (int x)
consolesety (int y)
consoleup (int n)
consoledn (int n)
consolelt (int n)
consolert (int n)
consolermln ()
consolefglite ()
consolefgdark ()
consolefgcol (short color)
consolebgcol (short color)

Public Attributes

FILE * in
FILE * out

Detailed Description

Console I/O and manipulation.

Inherits from axcel::io::input and axcel::io::output. Other specialized methods exist such as those for setting the console color or cursor position. No object of this class is ever meant to be declared by the programmer; instead, he/she should use con which is defined as a global console object whose input and output stream handles are attached to stdin and stdout.

Definition at line 1128 of file axcel.h.


Constructor & Destructor Documentation

axcel::console::console ( ) [inline]

Definition at line 1134 of file axcel.h.


Member Function Documentation

console & axcel::console::bel ( )

Definition at line 4668 of file axcel.cpp.

console & axcel::console::bgcol ( short  color)

Definition at line 4680 of file axcel.cpp.

console & axcel::console::cls ( )

Definition at line 4667 of file axcel.cpp.

console & axcel::console::dn ( int  n)

Definition at line 4673 of file axcel.cpp.

data axcel::console::dump ( ) [virtual]

Read until EOF.

Returns:
data object containing every byte read from this stream until an error or end-of-file was detected. This method may or may not block depending on the deriving object implementing this class.

Reimplemented from axcel::io::input.

Definition at line 221 of file axcel.cpp.

console & axcel::console::fgcol ( short  color)

Definition at line 4679 of file axcel.cpp.

console & axcel::console::fgdark ( )

Definition at line 4678 of file axcel.cpp.

console & axcel::console::fglite ( )

Definition at line 4677 of file axcel.cpp.

int axcel::console::getc ( ) [virtual]

Read byte.

Returns:
Character read as an unsigned char cast to an int or EOF on end of file or error

Reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error. Before returning from the method, one of the following methods of the stream must be called:

  • If end of file is reached, the method must call drain()
  • If a small error occurs but the stream is still usable, the method must call hurt()
  • If a fatal error occurs and the stream is unusable, the method must call kill()
  • If successful, the method must call heal()

Implements axcel::io::input.

Definition at line 4578 of file axcel.cpp.

int axcel::console::getch ( )

Immediate character input.

Returns:
Value of immediate character input if available (eg: press any key to continue. . .), otherwise this method blocks.

Definition at line 4621 of file axcel.cpp.

int axcel::console::getche ( )

Immediate character input with echo.

Returns:
Value of immediate character input with echo if available, otherwise this method blocks.

Definition at line 4633 of file axcel.cpp.

bool axcel::console::kbhit ( )

Check for available input.

Returns:
True if a character is available to be read from getch or getche.

Definition at line 4646 of file axcel.cpp.

console & axcel::console::lt ( int  n)

Definition at line 4675 of file axcel.cpp.

axcel::console::operator string ( ) [virtual]

Convert to string.

Returns:
Suitable string representation of object's data

Reimplemented from axcel::io::ios.

Definition at line 286 of file axcel.cpp.

console & axcel::console::putbs ( )

Definition at line 4666 of file axcel.cpp.

int axcel::console::putc ( int  c) [virtual]

Set destination address.

Set port

Implements axcel::io::output.

Definition at line 4569 of file axcel.cpp.

console & axcel::console::putcr ( )

Definition at line 4665 of file axcel.cpp.

console & axcel::console::rmln ( )

Definition at line 4676 of file axcel.cpp.

console & axcel::console::rt ( int  n)

Definition at line 4674 of file axcel.cpp.

console & axcel::console::setx ( int  x)

Definition at line 4670 of file axcel.cpp.

console & axcel::console::setxy ( int  x,
int  y 
)

Definition at line 4669 of file axcel.cpp.

console & axcel::console::sety ( int  y)

Definition at line 4671 of file axcel.cpp.

string axcel::console::type ( ) [virtual]

Get type of object.

Returns:
string containing name of object's class.

Reimplemented from axcel::io::ios.

Definition at line 260 of file axcel.cpp.

console & axcel::console::up ( int  n)

Definition at line 4672 of file axcel.cpp.


Member Data Documentation

Definition at line 1132 of file axcel.h.

Definition at line 1133 of file axcel.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Defines