Jive reference manual
List of all members | Public Types | Public Member Functions
jem::StringBuffer Class Reference

#include <jem/base/StringBuffer.h>

Inheritance diagram for jem::StringBuffer:
Inheritance graph

Public Types

typedef StringBuffer Self
 
typedef char ValueType
 
typedef char * Iterator
 
typedef const char * ConstIterator
 

Public Member Functions

 StringBuffer ()
 
 StringBuffer (idx_t size)
 
 StringBuffer (const String &str)
 
 StringBuffer (const Self &rhs)
 
virtual void write (int c)
 Writes a single character to this output stream. More...
 
virtual void write (int c, idx_t n)
 
virtual void write (const char *buf, idx_t len)
 
virtual void printByte (byte b)
 Prints a formatted byte to this output stream. More...
 
virtual void printBool (bool b)
 Prints a formatted bool to this output stream. More...
 
virtual void printInt (lint i)
 
virtual void printFloat (double d)
 Prints a formatted double to this output stream. More...
 
Selfoperator= (const Self &rhs)
 
Selfoperator= (const String &rhs)
 
template<class T >
Selfoperator+= (const T &rhs)
 
Selfoperator+= (const String &rhs)
 
Selfoperator+= (char rhs)
 
char & operator[] (idx_t i)
 
char operator[] (idx_t i) const
 
String operator[] (const Slice &s) const
 
String operator[] (const SliceFromTo &s) const
 
String operator[] (const SliceTo &s) const
 
String operator[] (const SliceFrom &s) const
 
String operator[] (const SliceAll &s) const
 
idx_t size () const
 
idx_t capacity () const
 
Iterator begin ()
 
ConstIterator begin () const
 
Iterator end ()
 
ConstIterator end () const
 
char & front ()
 
char front () const
 
char & back ()
 
char back () const
 
char * addr ()
 
const char * addr () const
 
void swap (Self &rhs)
 
void clear ()
 
void resize (idx_t size)
 
char * expand (idx_t len)
 
char * xalloc (idx_t len)
 
void commit (idx_t len)
 
void reserve (idx_t cap)
 
String toString ()
 
template<class T >
StringBufferoperator+= (const T &rhs)
 
- Public Member Functions inherited from jem::io::TextOutput
virtual void write (int c, int n)=0
 Writes multiple copies of a character to this output stream. More...
 
virtual void write (const char *buf, int n)=0
 Writes an array of characters to this output stream. More...
 
virtual void printInt (long i)=0
 Prints a formatted integer to this output stream. More...
 

Additional Inherited Members

- Protected Member Functions inherited from jem::Interface
virtual ~Interface ()
 Empty destructor. More...
 

Member Typedef Documentation

typedef const char* jem::StringBuffer::ConstIterator

Constructor & Destructor Documentation

jem::StringBuffer::StringBuffer ( )
jem::StringBuffer::StringBuffer ( idx_t  size)
explicit
jem::StringBuffer::StringBuffer ( const String str)
explicit
jem::StringBuffer::StringBuffer ( const Self rhs)

Member Function Documentation

virtual void jem::StringBuffer::write ( int  c)
virtual

Writes the integer c, cast to an unsigned char, to this output stream.

Parameters
c- the character to be written.
Exceptions
IOException- if an I/O error occurs.

Implements jem::io::TextOutput.

virtual void jem::StringBuffer::write ( int  c,
idx_t  n 
)
virtual
virtual void jem::StringBuffer::write ( const char *  buf,
idx_t  len 
)
virtual
virtual void jem::StringBuffer::printByte ( byte  b)
virtual

Prints the byte b, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.

Parameters
b- the byte to be printed.
Exceptions
IOException- if an I/O error occurs.
See also
operator << ( TextOutput&, byte )

Implements jem::io::TextOutput.

virtual void jem::StringBuffer::printBool ( bool  b)
virtual

Prints the bool b, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.

Parameters
b- the bool to be printed.
Exceptions
IOException- if an I/O error occurs.
See also
operator << ( TextOutput&, bool )

Implements jem::io::TextOutput.

virtual void jem::StringBuffer::printInt ( lint  i)
virtual
virtual void jem::StringBuffer::printFloat ( double  d)
virtual

Prints the double d, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.

Parameters
d- the double to be printed.
Exceptions
IOException- if an I/O error occurs.
See also
operator << ( TextOutput&, double )

Implements jem::io::TextOutput.

Self& jem::StringBuffer::operator= ( const Self rhs)
Self& jem::StringBuffer::operator= ( const String rhs)
template<class T >
Self& jem::StringBuffer::operator+= ( const T &  rhs)
Self& jem::StringBuffer::operator+= ( const String rhs)
Self& jem::StringBuffer::operator+= ( char  rhs)
char & jem::StringBuffer::operator[] ( idx_t  i)
char jem::StringBuffer::operator[] ( idx_t  i) const
String jem::StringBuffer::operator[] ( const Slice s) const
String jem::StringBuffer::operator[] ( const SliceFromTo s) const
String jem::StringBuffer::operator[] ( const SliceTo s) const
String jem::StringBuffer::operator[] ( const SliceFrom s) const
String jem::StringBuffer::operator[] ( const SliceAll s) const
idx_t jem::StringBuffer::size ( ) const
idx_t jem::StringBuffer::capacity ( ) const
char * jem::StringBuffer::begin ( )
const char * jem::StringBuffer::begin ( ) const
char * jem::StringBuffer::end ( )
const char * jem::StringBuffer::end ( ) const
char & jem::StringBuffer::front ( )
char jem::StringBuffer::front ( ) const
char & jem::StringBuffer::back ( )
char jem::StringBuffer::back ( ) const
char * jem::StringBuffer::addr ( )
const char * jem::StringBuffer::addr ( ) const
void jem::StringBuffer::swap ( Self rhs)
void jem::StringBuffer::clear ( )
void jem::StringBuffer::resize ( idx_t  size)
char * jem::StringBuffer::expand ( idx_t  len)
char * jem::StringBuffer::xalloc ( idx_t  len)
void jem::StringBuffer::commit ( idx_t  len)
void jem::StringBuffer::reserve ( idx_t  cap)
String jem::StringBuffer::toString ( )
template<class T >
StringBuffer& jem::StringBuffer::operator+= ( const T &  rhs)