Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Console_buffer Class Reference

A output console that stores the output in a buffer. More...

#include <jdb_console_buffer_i.h>

Inheritance diagram for Console_buffer:

Console List of all members.

Public Member Functions

 Console_buffer ()
 ~Console_buffer ()
int write (char const *str, size_t len)
 Write a string of len chacters to the output.
int getchar (bool)
 read a charcater from the input.
Mword get_attributes () const
 Console attributes.

Static Public Member Functions

static void alloc (size_t size)
 Allocates a buffer of the given size.
static int print_buffer (unsigned lines)
 Prints the buffer to the standard I/O.
static int print_buffer (const char *str)
 Prints the buffer to the standard I/O.
static FIASCO_INIT void init ()

Static Private Member Functions

static void at_jdb_enter ()
static void at_jdb_leave ()
static void inc_ptr (char **c)
static void dec_out_ptr (char **c)
static int strncmp (char *start, const char *search, size_t len)

Static Private Attributes

static bool _enabled
static size_t out_buf_size
static size_t out_buf_len
static char * out_buf
static char * out_buf_w

Detailed Description

A output console that stores the output in a buffer.

This buffer can be usefull for accessing older the debugging output without a serial console.


Constructor & Destructor Documentation

Console_buffer::Console_buffer  ) 
 

Console_buffer::~Console_buffer  ) 
 


Member Function Documentation

void Console_buffer::alloc size_t  size  )  [static]
 

Allocates a buffer of the given size.

Parameters:
size the buffer size in bytes.

void Console_buffer::at_jdb_enter  )  [static, private]
 

void Console_buffer::at_jdb_leave  )  [static, private]
 

void Console_buffer::dec_out_ptr char **  c  )  [inline, static, private]
 

Mword Console_buffer::get_attributes  )  const [virtual]
 

Console attributes.

Reimplemented from Console.

int Console_buffer::getchar bool   )  [virtual]
 

read a charcater from the input.

Parameters:
blocking if true getchar blocks til a charcater is available.
This method must be implemented in every implementation, but can simply return -1 for output only consoles.

Reimplemented from Console.

void Console_buffer::inc_ptr char **  c  )  [inline, static, private]
 

FIASCO_INIT void Console_buffer::init  )  [static]
 

int Console_buffer::print_buffer const char *  str  )  [static]
 

Prints the buffer to the standard I/O.

Parameters:
str the string the output should be filtered for This method prints the buffer contents to the normal I/O. Before doing this the buffer is disabled, that no recursion appers even if the buffer is part of the muxed I/O.

int Console_buffer::print_buffer unsigned  lines  )  [static]
 

Prints the buffer to the standard I/O.

Parameters:
lines the number of lines to skip. This method prints the buffer contents to the normal I/O. Before doing this the buffer is disabled, that no recursion appers even if the buffer is part of the muxed I/O.

int Console_buffer::strncmp char *  start,
const char *  search,
size_t  len
[static, private]
 

int Console_buffer::write char const *  str,
size_t  len
[virtual]
 

Write a string of len chacters to the output.

Parameters:
str the string to write (no zero termination is needed)
len the number of chacters to write.
This method must be implemented in every implementation, but can simply do nothing for input only consoles.

Reimplemented from Console.


Member Data Documentation

bool Console_buffer::_enabled [static, private]
 

char * Console_buffer::out_buf [static, private]
 

size_t Console_buffer::out_buf_len [static, private]
 

size_t Console_buffer::out_buf_size [static, private]
 

char * Console_buffer::out_buf_w [static, private]
 


The documentation for this class was generated from the following files:
Generated on Mon Sep 26 14:20:14 2005 for Fiasco by  doxygen 1.4.2