2005/5/9

     
 

class StringBuffer

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::StringBuffer Class Reference

#include <StringBuffer.h>

Inheritance diagram for acdk::lang::StringBuffer:

acdk::lang::Object acdk::lang::Cloneable acdk::io::Serializable acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

The Stringbuffer should work in a quite similar way to the java StringBuffer.

API: Java

Author:
Roger Rene Kommer
Version:
Revision
1.42
Date:
Date
2005/03/07 13:49:04
See also:
String


Public Member Functions

 StringBuffer ()
 StringBuffer (size_t cap)
 StringBuffer (IN(RString) str)
virtual ~StringBuffer ()
bool isCChar ()
bool isUc2Char ()
bool isUc4Char ()
RString toString ()
 return a string representation of this object Object::toString() return getName() by default

int length ()
 return the length of the byte chars

void reset ()
 API: ACDK
resets the internal string, without freeing internal buffer.
Note: if internal buffer is shared with another String, internally _unshare will be called.

uc2char charAt (int idx)
 returns the char at byte char position

void setCharAt (int idx, char c)
 set char at index position

void setCharAt (int idx, uc2char c)
RStringBuffer set (IN(RString) str)
 replace current buffer with given argument.

void getChars (int srcBegin, int srcEnd, IN(RcharArray) dst, int dstBegin, IN(acdk::locale::REncoder) enc)
 Kopiert die Zeichen ab der Position srcBegin bis zur Position srcEnd in den Puffer dst, wobei srcEnd die Position hinter dem letzten zu kopierenden Zeichen ist.

RStringBuffer reverse ()
 API: JDK
reverse this buffer.

RStringBuffer append (const char *cptr, int len=-1)
 API: ACDK.

RStringBuffer append (const uc2char *cptr, int len=-1)
RStringBuffer append (IN(RString) c)
RStringBuffer append (const String &str)
RStringBuffer append (String::iterator begin, String::iterator end)
RStringBuffer append (char c)
 API: JDK
Status: Basic Tests.

RStringBuffer append (uc2char c)
RStringBuffer append (bool b)
RStringBuffer append (int b)
RStringBuffer append (jlong b)
RStringBuffer append (float b)
RStringBuffer append (double b)
RStringBuffer append (IN(RObject) b)
int capacity ()
void ensureCapacity (int mincap)
 ensure capacity of mincap chars

void setLength (int newLength) throw ( RIndexOutOfBoundsException )
RStringBuffer deleteRegion (int start, int end) throw ( RIndexOutOfBoundsException )
 API: like JDK.

RStringBuffer deleteCharAt (int index) throw ( RIndexOutOfBoundsException )
 API: like JDK.

RStringBuffer replace (int start, int end, IN(RString) str) throw ( RIndexOutOfBoundsException )
RString substring (int start, int end=-1) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int index, const String &str)
RStringBuffer insert (int index, const char *str)
RStringBuffer insert (int index, const uc2char *str)
RStringBuffer insert (int index, const char *str, int offset, int len)
RStringBuffer insert (int index, const uc2char *str, int offset, int len)
RStringBuffer insert (int offset, IN(RString) str) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, char ch) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, uc2char ch) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, IN(RObject) obj) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, int b) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, jlong l) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, double d) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, float f) throw ( RIndexOutOfBoundsException )
RStringBuffer insert (int offset, bool b) throw ( RIndexOutOfBoundsException )
RStringBuffer append (int offset, int b) throw ( RIndexOutOfBoundsException )
RStringBuffer operator+= (IN(RString) other)
 mainly used via DMI

RStringBuffer operator+= (IN(RObject) other)
 mainly used via DMI

RStringBuffer operator+= (bool other)
 mainly used via DMI

RStringBuffer operator+= (char other)
 mainly used via DMI

RStringBuffer operator+= (uc2char other)
RStringBuffer operator+= (byte other)
 mainly used via DMI

RStringBuffer operator+= (short other)
 mainly used via DMI

RStringBuffer operator+= (int other)
 mainly used via DMI

RStringBuffer operator+= (jlong other)
 mainly used via DMI

RStringBuffer operator+= (float other)
 mainly used via DMI

RStringBuffer operator+= (double other)
 mainly used via DMI

RStringBuffer operator_lt_lt (IN(RString) other)
 mainly used via DMI

RStringBuffer operator_lt_lt (IN(RObject) other)
 mainly used via DMI

RStringBuffer operator_lt_lt (bool other)
 mainly used via DMI

RStringBuffer operator_lt_lt (char other)
 mainly used via DMI

RStringBuffer operator_lt_lt (uc2char other)
RStringBuffer operator_lt_lt (byte other)
 mainly used via DMI

RStringBuffer operator_lt_lt (short other)
 mainly used via DMI

RStringBuffer operator_lt_lt (int other)
 mainly used via DMI

RStringBuffer operator_lt_lt (jlong other)
 mainly used via DMI

RStringBuffer operator_lt_lt (float other)
 mainly used via DMI

RStringBuffer operator_lt_lt (double other)
 mainly used via DMI

bool equals (IN(RObject) o)
 API: extended Checks if o is StringBuffer or String and tests strcmp.

RObject clone (sys::Allocator *alc)
 reimplemented from Object

RObject clone ()
 reimplemented from Object

const char * c_str ()
 API: ACDK.


Static Public Member Functions

RObject create_instance ()

Private Member Functions

void _unShare (int mincap=0)
void _unShare2 (int mincap)

Private Attributes

RString _str
bool _shared


Constructor & Destructor Documentation

acdk::lang::StringBuffer::StringBuffer  ) 
 

acdk::lang::StringBuffer::StringBuffer size_t  cap  ) 
 

acdk::lang::StringBuffer::StringBuffer IN(RString str  ) 
 

virtual acdk::lang::StringBuffer::~StringBuffer  )  [inline, virtual]
 


Member Function Documentation

void acdk::lang::StringBuffer::_unShare int  mincap = 0  )  [inline, private]
 

Parameters:
mincap are bytes capacity

void acdk::lang::StringBuffer::_unShare2 int  mincap  )  [private]
 

Parameters:
mincap are bytes

RStringBuffer acdk::lang::StringBuffer::append int  offset,
int  b
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::append IN(RObject b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append double  b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append float  b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append jlong  b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append int  b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append bool  b  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append uc2char  c  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append char  c  )  [inline]
 

API: JDK
Status: Basic Tests.

RStringBuffer acdk::lang::StringBuffer::append String::iterator  begin,
String::iterator  end
 

RStringBuffer acdk::lang::StringBuffer::append const String str  ) 
 

RStringBuffer acdk::lang::StringBuffer::append IN(RString c  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::append const uc2char cptr,
int  len = -1
 

RStringBuffer acdk::lang::StringBuffer::append const char *  cptr,
int  len = -1
 

API: ACDK.

const char* acdk::lang::StringBuffer::c_str  )  [inline]
 

API: ACDK.

Returns:
internal char buffer

int acdk::lang::StringBuffer::capacity  )  [inline]
 

uc2char acdk::lang::StringBuffer::charAt int  idx  )  [inline]
 

returns the char at byte char position

RObject acdk::lang::StringBuffer::clone  )  [inline, virtual]
 

reimplemented from Object

Implements acdk::lang::Cloneable.

RObject acdk::lang::StringBuffer::clone sys::Allocator alc  )  [inline, virtual]
 

reimplemented from Object

Reimplemented from acdk::lang::Cloneable.

RObject acdk::lang::StringBuffer::create_instance  )  [inline, static]
 

Reimplemented from acdk::lang::Object.

RStringBuffer acdk::lang::StringBuffer::deleteCharAt int  index  )  throw ( RIndexOutOfBoundsException )
 

API: like JDK.

renamed from delete to deleteRegion

Parameters:
start unicode char index
end unicode char index

RStringBuffer acdk::lang::StringBuffer::deleteRegion int  start,
int  end
throw ( RIndexOutOfBoundsException )
 

API: like JDK.

renamed from delete to deleteRegion

Parameters:
start byte char index
end byte char index

void acdk::lang::StringBuffer::ensureCapacity int  mincap  ) 
 

ensure capacity of mincap chars

bool acdk::lang::StringBuffer::equals IN(RObject o  )  [virtual]
 

API: extended Checks if o is StringBuffer or String and tests strcmp.

Reimplemented from acdk::lang::Object.

void acdk::lang::StringBuffer::getChars int  srcBegin,
int  srcEnd,
IN(RcharArray dst,
int  dstBegin,
IN(acdk::locale::REncoder enc
[inline]
 

Kopiert die Zeichen ab der Position srcBegin bis zur Position srcEnd in den Puffer dst, wobei srcEnd die Position hinter dem letzten zu kopierenden Zeichen ist.

dstBegin legt fest, ab welcher Position im Puffer die Zeichen hineinkopiert werden. Wenn srcEnd kleiner gleich srcBegin ist, bleibt die Methode wirkungslos.

Parameters:
srcBegin 
srcEnd 
dst 
dstBegin 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
bool  b
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
float  f
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
double  d
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
jlong  l
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
int  b
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
IN(RObject obj
throw ( RIndexOutOfBoundsException )
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
uc2char  ch
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
char  ch
throw ( RIndexOutOfBoundsException ) [inline]
 

RStringBuffer acdk::lang::StringBuffer::insert int  offset,
IN(RString str
throw ( RIndexOutOfBoundsException )
 

RStringBuffer acdk::lang::StringBuffer::insert int  index,
const uc2char str,
int  offset,
int  len
 

Parameters:
index unicode char index
offset byte ofset into string
len byte length of string

RStringBuffer acdk::lang::StringBuffer::insert int  index,
const char *  str,
int  offset,
int  len
 

RStringBuffer acdk::lang::StringBuffer::insert int  index,
const uc2char str
 

RStringBuffer acdk::lang::StringBuffer::insert int  index,
const char *  str
 

RStringBuffer acdk::lang::StringBuffer::insert int  index,
const String str
 

bool acdk::lang::StringBuffer::isCChar  )  [inline]
 

bool acdk::lang::StringBuffer::isUc2Char  )  [inline]
 

bool acdk::lang::StringBuffer::isUc4Char  )  [inline]
 

int acdk::lang::StringBuffer::length  )  [inline]
 

return the length of the byte chars

RStringBuffer acdk::lang::StringBuffer::operator+= double  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= float  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= jlong  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= int  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= short  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= byte  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= uc2char  other  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::operator+= char  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= bool  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= IN(RObject other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator+= IN(RString other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt double  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt float  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt jlong  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt int  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt short  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt byte  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt uc2char  other  )  [inline]
 

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt char  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt bool  other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt IN(RObject other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::operator_lt_lt IN(RString other  )  [inline]
 

mainly used via DMI

RStringBuffer acdk::lang::StringBuffer::replace int  start,
int  end,
IN(RString str
throw ( RIndexOutOfBoundsException )
 

void acdk::lang::StringBuffer::reset  ) 
 

API: ACDK
resets the internal string, without freeing internal buffer.
Note: if internal buffer is shared with another String, internally _unshare will be called.

RStringBuffer acdk::lang::StringBuffer::reverse  ) 
 

API: JDK
reverse this buffer.

Returns:
this

RStringBuffer acdk::lang::StringBuffer::set IN(RString str  ) 
 

replace current buffer with given argument.

API: ACDK

Parameters:
str the new String
Returns:
this

void acdk::lang::StringBuffer::setCharAt int  idx,
uc2char  c
 

void acdk::lang::StringBuffer::setCharAt int  idx,
char  c
 

set char at index position

void acdk::lang::StringBuffer::setLength int  newLength  )  throw ( RIndexOutOfBoundsException )
 

Parameters:
newLength character length

RString acdk::lang::StringBuffer::substring int  start,
int  end = -1
throw ( RIndexOutOfBoundsException )
 

RString acdk::lang::StringBuffer::toString  )  [inline, virtual]
 

return a string representation of this object Object::toString() return getName() by default

Reimplemented from acdk::lang::Object.


Member Data Documentation

bool acdk::lang::StringBuffer::_shared [mutable, private]
 

RString acdk::lang::StringBuffer::_str [private]