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

mootio::micbuffer Class Reference

Streambuf-like class for input from C char* buffers. More...

#include <mootBufferIO.h>

Inheritance diagram for mootio::micbuffer:

Inheritance graph
[legend]
Collaboration diagram for mootio::micbuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors etc.
Checks and Properties
Input Methods
Utilities

Public Attributes


Detailed Description

This class provides an API for in-memory input which does not resort to C++ sstream : this is a Good Thing, because:


Constructor & Destructor Documentation

mootio::micbuffer::micbuffer const void *  data,
size_t  len
[inline]
 

Constructor from a user-specified buffer Read operations will be performed on the buffer specified. User is responsible for freeing memory associated with passed to this constructor.

mootio::micbuffer::micbuffer const micbuffer cb  )  [inline]
 

Copy constructor

virtual mootio::micbuffer::~micbuffer void   )  [inline, virtual]
 

Destructor


Member Function Documentation

std::string mootio::micbuffer::as_string bool  normalize_ws = false,
bool  trim_left = false,
bool  trim_right = false
const [inline]
 

Return the unread portion of the buffer as a new STL string. @param normalize_ws Whether to normalize whitespace (replace all whitespace substrings with a single space). @param trim_left whether to trim all leading whitespace @param trim_right whether to trim all trailing whitespace

void mootio::micbuffer::assign const void *  data,
size_t  len
[inline]
 

Asignment to a different data buffer

Reimplemented in mootio::mcbuffer.

size_t mootio::micbuffer::capacity void   )  const [inline]
 

Get current allocated size of data buffer

void mootio::micbuffer::clear void   )  [inline]
 

Clear buffer

Reimplemented in mootio::mcbuffer.

const char* mootio::micbuffer::data void   )  const [inline]
 

Get pointer to current read buffer (whole thing)

virtual bool mootio::micbuffer::eof void   )  [inline, virtual]
 

Check for end-of-buffer (only meaningful for read operations)

Reimplemented from mootio::mstream.

virtual int mootio::micbuffer::getc void   )  [inline, virtual]
 

Read a single byte of data

Reimplemented from mootio::mistream.

size_t mootio::micbuffer::offset void   )  const [inline]
 

Get current read-offset of data buffer

virtual ByteCount mootio::micbuffer::read char *  buf,
size_t  n
[inline, virtual]
 

Read up to
bytes of data into , returns number of bytes actually read.

Reimplemented from mootio::mistream.

void mootio::micbuffer::release void   )  [inline]
 

Free locally allocated data buffer, if any. Implicitly calls clear()

Reimplemented in mootio::mcbuffer.

size_t mootio::micbuffer::size void   )  const [inline]
 

Get current used size of data buffer

void mootio::micbuffer::to_string std::string &  str,
bool  normalize_ws = false,
bool  trim_left = false,
bool  trim_right = false
const [inline]
 

Append the unread portion of the buffer to an existing STL string. @param str destination string @param normalize_ws Whether to normalize whitespace (replace all whitespace substrings with a single space). @param trim_left whether to trim all leading whitespace @param trim_right whether to trim all trailing whitespace

virtual bool mootio::micbuffer::valid void   )  [inline, virtual]
 

Check for buffer validity

Reimplemented from mootio::mstream.


Member Data Documentation

size_t mootio::micbuffer::cb_offset
 

const char* mootio::micbuffer::cb_rdata
 

size_t mootio::micbuffer::cb_used
 


The documentation for this class was generated from the following file:
Generated on Mon Jun 27 13:05:30 2005 for libmoot by  doxygen 1.3.8-20040913