Public Member Functions | Private Member Functions | Private Attributes

StreamBuffer Class Reference

#include <StreamBuffer.h>

Public Member Functions

 StreamBuffer ()
 StreamBuffer (const void *s, long size)
 StreamBuffer (const char *s)
 StreamBuffer (const StreamBuffer &s)
 StreamBuffer (long size)
 ~StreamBuffer ()
const char * operator() (long index=0) const
char * operator() (long index=0)
char operator[] (long index) const
char & operator[] (long index)
 operator bool () const
long length () const
long capacity () const
const char * end () const
StreamBufferclear ()
char * reserve (long size)
StreamBufferappend (char c)
StreamBufferappend (char c, long count)
StreamBufferappend (const void *s, long size)
StreamBufferappend (const char *s)
StreamBufferappend (const StreamBuffer &s)
StreamBufferoperator+= (char c)
StreamBufferoperator+= (const char *s)
StreamBufferoperator+= (const StreamBuffer &s)
StreamBufferset (const void *s, long size)
StreamBufferset (const char *s)
StreamBufferset (const StreamBuffer &s)
StreamBufferoperator= (const char *s)
StreamBufferoperator= (const StreamBuffer &s)
StreamBufferreplace (long pos, long length, const void *s, long size)
StreamBufferreplace (long pos, long length, const char *s)
StreamBufferreplace (long pos, long length, const StreamBuffer &s)
StreamBufferremove (long pos, long length)
StreamBufferremove (long length)
StreamBuffertruncate (long pos)
StreamBufferinsert (long pos, const void *s, long size)
StreamBufferinsert (long pos, const char *s)
StreamBufferinsert (long pos, const StreamBuffer &s)
StreamBufferinsert (long pos, char c)
StreamBufferprintf (const char *fmt,...) __attribute__((format(printf
StreamBuffer long find (char c, long start=0) const
long find (const void *s, long size, long start=0) const
long find (const char *s, long start=0) const
long int find (const StreamBuffer &s, long start=0) const
bool startswith (const void *s, long size) const
bool startswith (const char *s) const
StreamBuffer expand (long start, long length) const
StreamBuffer expand (long start=0) const
StreamBuffer dump () const

Private Member Functions

void init (const void *s, long minsize)
void check (long size)
void grow (long minsize)

Private Attributes

char local [64]
long len
long cap
long offs
char * buffer

Detailed Description

Definition at line 30 of file StreamBuffer.h.


Constructor & Destructor Documentation

StreamBuffer::StreamBuffer (  )  [inline]

Definition at line 55 of file StreamBuffer.h.

References init().

StreamBuffer::StreamBuffer ( const void *  s,
long  size 
) [inline]

Definition at line 58 of file StreamBuffer.h.

References init().

StreamBuffer::StreamBuffer ( const char *  s  )  [inline]

Definition at line 61 of file StreamBuffer.h.

References init().

StreamBuffer::StreamBuffer ( const StreamBuffer s  )  [inline]

Definition at line 64 of file StreamBuffer.h.

References buffer, init(), len, and offs.

StreamBuffer::StreamBuffer ( long  size  )  [inline]

Definition at line 67 of file StreamBuffer.h.

References init().

StreamBuffer::~StreamBuffer (  )  [inline]

Definition at line 70 of file StreamBuffer.h.

References buffer, and local.


Member Function Documentation

StreamBuffer& StreamBuffer::append ( char  c  )  [inline]

Definition at line 113 of file StreamBuffer.h.

References buffer, check(), len, and offs.

Referenced by operator+=(), and set().

StreamBuffer& StreamBuffer::append ( const void *  s,
long  size 
)
StreamBuffer& StreamBuffer::append ( const char *  s  )  [inline]

Definition at line 123 of file StreamBuffer.h.

References append().

Referenced by append().

StreamBuffer& StreamBuffer::append ( const StreamBuffer s  )  [inline]

Definition at line 126 of file StreamBuffer.h.

References append(), buffer, len, and offs.

Referenced by append().

StreamBuffer& StreamBuffer::append ( char  c,
long  count 
) [inline]

Definition at line 116 of file StreamBuffer.h.

References buffer, check(), len, offs, and truncate().

long StreamBuffer::capacity (  )  const [inline]

Definition at line 96 of file StreamBuffer.h.

References cap.

void StreamBuffer::check ( long  size  )  [inline, private]

Definition at line 40 of file StreamBuffer.h.

References cap, grow(), len, and offs.

Referenced by append(), and reserve().

StreamBuffer& StreamBuffer::clear (  )  [inline]

Definition at line 104 of file StreamBuffer.h.

References len, and offs.

Referenced by set().

StreamBuffer StreamBuffer::dump (  )  const
const char* StreamBuffer::end (  )  const [inline]

Definition at line 100 of file StreamBuffer.h.

References buffer, len, and offs.

StreamBuffer StreamBuffer::expand ( long  start = 0  )  const [inline]

Definition at line 223 of file StreamBuffer.h.

References expand(), and len.

Referenced by expand().

StreamBuffer StreamBuffer::expand ( long  start,
long  length 
) const
StreamBuffer long StreamBuffer::find ( char  c,
long  start = 0 
) const [inline]

Definition at line 196 of file StreamBuffer.h.

References buffer, len, and offs.

long StreamBuffer::find ( const void *  s,
long  size,
long  start = 0 
) const
long StreamBuffer::find ( const char *  s,
long  start = 0 
) const [inline]

Definition at line 205 of file StreamBuffer.h.

References find().

Referenced by find().

long int StreamBuffer::find ( const StreamBuffer s,
long  start = 0 
) const [inline]

Definition at line 208 of file StreamBuffer.h.

References buffer, find(), len, and offs.

Referenced by find().

void StreamBuffer::grow ( long  minsize  )  [private]

Referenced by check().

void StreamBuffer::init ( const void *  s,
long  minsize 
) [private]

Referenced by StreamBuffer().

StreamBuffer& StreamBuffer::insert ( long  pos,
const StreamBuffer s 
) [inline]

Definition at line 186 of file StreamBuffer.h.

References buffer, len, offs, and replace().

StreamBuffer& StreamBuffer::insert ( long  pos,
const void *  s,
long  size 
) [inline]

Definition at line 180 of file StreamBuffer.h.

References replace().

StreamBuffer& StreamBuffer::insert ( long  pos,
const char *  s 
) [inline]

Definition at line 183 of file StreamBuffer.h.

References replace().

StreamBuffer& StreamBuffer::insert ( long  pos,
char  c 
) [inline]

Definition at line 189 of file StreamBuffer.h.

References replace().

long StreamBuffer::length (  )  const [inline]

Definition at line 92 of file StreamBuffer.h.

References len.

Referenced by remove().

StreamBuffer::operator bool (  )  const [inline]

Definition at line 88 of file StreamBuffer.h.

References len.

const char* StreamBuffer::operator() ( long  index = 0  )  const [inline]

Definition at line 74 of file StreamBuffer.h.

References buffer, len, and offs.

char* StreamBuffer::operator() ( long  index = 0  )  [inline]

Definition at line 77 of file StreamBuffer.h.

References buffer, len, and offs.

StreamBuffer& StreamBuffer::operator+= ( char  c  )  [inline]

Definition at line 130 of file StreamBuffer.h.

References append().

StreamBuffer& StreamBuffer::operator+= ( const StreamBuffer s  )  [inline]

Definition at line 136 of file StreamBuffer.h.

References append().

StreamBuffer& StreamBuffer::operator+= ( const char *  s  )  [inline]

Definition at line 133 of file StreamBuffer.h.

References append().

StreamBuffer& StreamBuffer::operator= ( const char *  s  )  [inline]

Definition at line 150 of file StreamBuffer.h.

StreamBuffer& StreamBuffer::operator= ( const StreamBuffer s  )  [inline]

Definition at line 153 of file StreamBuffer.h.

char StreamBuffer::operator[] ( long  index  )  const [inline]

Definition at line 81 of file StreamBuffer.h.

References buffer, len, and offs.

char& StreamBuffer::operator[] ( long  index  )  [inline]

Definition at line 84 of file StreamBuffer.h.

References buffer, len, and offs.

StreamBuffer& StreamBuffer::printf ( const char *  fmt,
  ... 
)
StreamBuffer& StreamBuffer::remove ( long  length  )  [inline]

Definition at line 171 of file StreamBuffer.h.

References len, length(), and offs.

StreamBuffer& StreamBuffer::remove ( long  pos,
long  length 
) [inline]

Definition at line 167 of file StreamBuffer.h.

References length(), and replace().

StreamBuffer& StreamBuffer::replace ( long  pos,
long  length,
const StreamBuffer s 
) [inline]

Definition at line 163 of file StreamBuffer.h.

References buffer, len, offs, and replace().

Referenced by replace().

StreamBuffer& StreamBuffer::replace ( long  pos,
long  length,
const void *  s,
long  size 
)

Referenced by insert(), remove(), and truncate().

StreamBuffer& StreamBuffer::replace ( long  pos,
long  length,
const char *  s 
) [inline]

Definition at line 160 of file StreamBuffer.h.

References replace().

Referenced by replace().

char* StreamBuffer::reserve ( long  size  )  [inline]

Definition at line 109 of file StreamBuffer.h.

References buffer, check(), len, and offs.

StreamBuffer& StreamBuffer::set ( const StreamBuffer s  )  [inline]

Definition at line 146 of file StreamBuffer.h.

References append(), and clear().

StreamBuffer& StreamBuffer::set ( const char *  s  )  [inline]

Definition at line 143 of file StreamBuffer.h.

References append(), and clear().

StreamBuffer& StreamBuffer::set ( const void *  s,
long  size 
) [inline]

Definition at line 140 of file StreamBuffer.h.

References append(), and clear().

bool StreamBuffer::startswith ( const char *  s  )  const [inline]

Definition at line 216 of file StreamBuffer.h.

References buffer, len, and offs.

bool StreamBuffer::startswith ( const void *  s,
long  size 
) const [inline]

Definition at line 212 of file StreamBuffer.h.

References buffer, len, and offs.

StreamBuffer& StreamBuffer::truncate ( long  pos  )  [inline]

Definition at line 176 of file StreamBuffer.h.

References len, and replace().

Referenced by append().


Field Documentation

char* StreamBuffer::buffer [private]
long StreamBuffer::cap [private]

Definition at line 34 of file StreamBuffer.h.

Referenced by capacity(), and check().

long StreamBuffer::len [private]
char StreamBuffer::local[64] [private]

Definition at line 32 of file StreamBuffer.h.

Referenced by ~StreamBuffer().

long StreamBuffer::offs [private]

The documentation for this class was generated from the following file: