Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
StringBuffer Class Reference

#include <elm/string/StringBuffer.h>

+ Inheritance diagram for StringBuffer:

Public Member Functions

 StringBuffer (int capacity=64, int increment=32)
 
String toString ()
 
CString toCString ()
 
String copyString ()
 
int length (void) const
 
void reset (void)
 
io::OutStreamstream (void)
 
- Public Member Functions inherited from 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 print (const StringFormat &fmt)
 
void format (CString fmt,...)
 
void format (CString fmt, VarArg &args)
 
bool supportsANSI ()
 
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

◆ StringBuffer()

StringBuffer ( int  capacity = 64,
int  increment = 32 
)
inline

Build a new string buffer.

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

Member Function Documentation

◆ copyString()

String copyString ( )
inline

◆ length()

int length ( void  ) const
inline

Get the length of the string stored in the buffer.

Returns
String length.

References BlockOutStream::size().

Referenced by ProcessBuilder::run(), and StringBuffer::toString().

◆ reset()

void reset ( void  )
inline

Remove all characters from the string buffer.

References BlockOutStream::clear().

Referenced by VarExpander::write().

◆ stream()

io::OutStream & stream ( void  )
inline

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

Returns
Stream to the string buffer.

Referenced by VarExpander::expand(), and Saver::Saver().

◆ toCString()

CString toCString ( )
inline

◆ toString()


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