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

File-like buffer. More...

#include <axcel.h>

Inheritance diagram for axcel::data:
axcel::io::ios axcel::io::input axcel::io::output axcel::io::iob axcel::io::iob axcel::object axcel::object axcel::string

List of all members.

Public Member Functions

virtual string type ()
 "data"
virtual operator string ()
 Convert to string.
 data (const data &d)
char & operator[] (int i)
dataoperator= (const char *s)
dataoperator= (object &o)
dataoperator= (data d)
bool operator== (data d)
bool operator== (const char *s)
bool operator== (object &o)
bool operator!= (data d)
bool operator!= (const char *s)
bool operator!= (object &o)
 data ()
 ~data ()
virtual int getc ()
 Read byte.
virtual int putc (int c)
 Write byte.
virtual bool seek (long offset, int whence)
virtual size_t tell ()
virtual void rewind ()
virtual void unwind ()
virtual bool ffwd (size_t offset)
virtual bool prev (size_t offset)
virtual size_t len () const
virtual void realloc (size_t n)
virtual operator void * ()
virtual operator char * ()

Public Attributes

char * buf

Protected Attributes

size_t pos
size_t mlen
size_t slen

Detailed Description

File-like buffer.

A type of buffer class whose data can be read or written to like a file stream.

Definition at line 536 of file axcel.h.


Constructor & Destructor Documentation

axcel::data::data ( const data d)

Definition at line 1387 of file axcel.cpp.

axcel::data::data ( )

Definition at line 1414 of file axcel.cpp.

axcel::data::~data ( )

Definition at line 1415 of file axcel.cpp.


Member Function Documentation

bool axcel::data::ffwd ( size_t  offset) [virtual]

Definition at line 1444 of file axcel.cpp.

int axcel::data::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.

Reimplemented in axcel::string.

Definition at line 1423 of file axcel.cpp.

size_t axcel::data::len ( ) const [virtual]

Definition at line 1384 of file axcel.cpp.

virtual axcel::data::operator char * ( ) [inline, virtual]

Reimplemented in axcel::string.

Definition at line 575 of file axcel.h.

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

Convert to string.

The string represenation of this object is the hex values of all the bytes in the internal data buffer delimited by spaces.

Reimplemented from axcel::io::ios.

Reimplemented in axcel::string.

Definition at line 1377 of file axcel.cpp.

virtual axcel::data::operator void * ( ) [inline, virtual]

Definition at line 574 of file axcel.h.

bool axcel::data::operator!= ( data  d)

Definition at line 1386 of file axcel.cpp.

bool axcel::data::operator!= ( const char *  s)

Reimplemented in axcel::string.

bool axcel::data::operator!= ( object o)
data & axcel::data::operator= ( object o)

Definition at line 243 of file axcel.cpp.

data & axcel::data::operator= ( const char *  s)

Reimplemented in axcel::string.

Definition at line 236 of file axcel.cpp.

data & axcel::data::operator= ( data  d)

Definition at line 1394 of file axcel.cpp.

bool axcel::data::operator== ( const char *  s)

Reimplemented in axcel::string.

bool axcel::data::operator== ( object o)
bool axcel::data::operator== ( data  d)

Definition at line 1385 of file axcel.cpp.

char & axcel::data::operator[] ( int  i)

Reimplemented in axcel::string.

Definition at line 1393 of file axcel.cpp.

bool axcel::data::prev ( size_t  offset) [virtual]

Definition at line 1449 of file axcel.cpp.

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

Write byte.

Parameters:
cCharacter to write
Returns:
Character written or EOF on end of file or error

Writes character c to stream and returns a non-negative number on success or EOF on error. Before returning from within this method, one of the following methods must be called:

  • If end of file is reached, the method must call drain()
  • If an error occurs, the method must call kill()
  • If successful, the method must call heal()

Implements axcel::io::output.

Reimplemented in axcel::string.

Definition at line 1429 of file axcel.cpp.

void axcel::data::realloc ( size_t  n) [virtual]

Definition at line 1403 of file axcel.cpp.

void axcel::data::rewind ( ) [virtual]

Definition at line 1442 of file axcel.cpp.

bool axcel::data::seek ( long  offset,
int  whence 
) [virtual]

Definition at line 1433 of file axcel.cpp.

size_t axcel::data::tell ( ) [virtual]

Definition at line 1441 of file axcel.cpp.

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

"data"

Reimplemented from axcel::io::ios.

Reimplemented in axcel::string.

Definition at line 1376 of file axcel.cpp.

void axcel::data::unwind ( ) [virtual]

Definition at line 1443 of file axcel.cpp.


Member Data Documentation

Definition at line 540 of file axcel.h.

size_t axcel::data::mlen [protected]

Definition at line 538 of file axcel.h.

size_t axcel::data::pos [protected]

Definition at line 538 of file axcel.h.

size_t axcel::data::slen [protected]

Definition at line 538 of file axcel.h.


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