Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::StringBuffer Class Reference

#include <elm/string/StringBuffer.h>

+ Inheritance diagram for elm::StringBuffer:

Public Member Functions

 StringBuffer (int capacity=64, int increment=32)
 
String toString (void)
 
String copyString (void)
 
int length (void) const
 
void reset (void)
 
io::OutStreamstream (void)
 
- Public Member Functions inherited from elm::io::Output
 Output (void)
 
 Output (OutStream &stream)
 
OutStreamstream (void) const
 
void setStream (OutStream &stream)
 
void flush (void)
 
void print (bool value)
 
void print (char chr)
 
void print (double value)
 
void print (void *value)
 
void print (const char *str)
 
void print (const CString str)
 
void print (const String &str)
 
void print (const IntFormat &fmt)
 
void print (const FloatFormat &fmt)
 
void format (CString fmt,...)
 
void format (CString fmt, VarArg &args)
 
void print (t::int32 value)
 
void print (t::uint32 value)
 
void print (t::int64 value)
 
void print (t::uint64 value)
 

Detailed Description

As the ELM String class is immutable, the big building of strings may have a prohibitive cost. Instead, this class provides an economic way of concatenating strings.

Constructor & Destructor Documentation

elm::StringBuffer::StringBuffer ( int  capacity = 64,
int  increment = 32 
)

Build a new string buffer.

Parameters
capacityInitial capacity of the buffer.
incrementIncrementation size when buffer is enlarged.

References elm::io::BlockOutStream::write().

Member Function Documentation

String elm::StringBuffer::copyString ( void  )
int elm::StringBuffer::length ( void  ) const

Get the length of the string stored in the buffer.

Returns
String length.

References elm::io::BlockOutStream::size().

Referenced by elm::sys::ProcessBuilder::run(), and toString().

void elm::StringBuffer::reset ( void  )

Remove all characters from the string buffer.

References elm::io::BlockOutStream::setSize().

io::OutStream & elm::StringBuffer::stream ( void  )

Get the an output stream to write to the string buffer.

Returns
Stream to the string buffer.

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