2005/5/9

     
 

class String

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

acdk::lang::String Class Reference
[ACDK String macros/function/classes]

#include <String.h>

Inheritance diagram for acdk::lang::String:

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

Detailed Description

Similar to Java but extended Some extional function are inspired by the org.apache.commons.lang.StringUtils class.

See also:
For more details see  String
Author:
Roger Rene Kommer
Version:
Revision
1.73
Date:
Date
2005/04/28 11:13:07


Public Types

typedef int(* CharConvertFunc )(int c)
typedef bytebyte_iterator
 standard iterator over single byte chars

typedef unsigned short StringFlags
typedef StringIterator iterator

Public Member Functions

 String ()
 constructs an empty string

 String (IN(RString) str, int start=0, int length=-1)
 Creates a Substring from given str.

 String (const String &str, int start, int length=-1)
 Creates a Substring from given str.

 String (StringBuffer &buf, int start=0, int end=-1)
 Creates a Substring from given str.

 String (IN(RStringBuffer) buf, int start=0, int end=-1)
 Creates a Substring from given str.

 String (const char *ptr, int flags=ConstSST|CCAscii)
 Create instance of given C-str.

 String (const uc2char *ptr, int flags=ConstSST|CCUcs2)
 initialize with const wide char character

 String (const uc4char *ptr)
 initialize with a 4 byte unicode character will be converted to a uc2char internally

 String (const char *ptr, int length, int flags)
 Create instance of given C-str.

 String (const uc2char *ptr, int length, int flags)
 using wide character to initilize

 String (IN(RbyteArray) ba, int offset=0, int size=-1)
 String (IN(RbyteArray) ba, IN(acdk::locale::RDecoder) decoder, int offset=0, int size=-1)
 String (const byte *cptr, IN(acdk::locale::RDecoder) decoder, int offset=0, int size=-1)
 String (IN(RcharArray) ba, int offset=0, int size=-1)
 initilize string with UTF8 or ASCII character stream

 String (IN(RuccharArray) ba, int offset=0, int size=-1)
 initialize with unicode character array

 String (byte *buffer, int bufferlength, byte_iterator begin, byte_iterator end, StringFlags flags)
 internal constructor to create string with prepared stream

 String (const StaticAsciiLiteral &strLit)
 String (String *parent, byte_iterator bit, byte_iterator eit)
 Construct a new Substring.

 String (iterator begin, iterator end)
 creates new string

 String (int buffersize)
 Constructs a Normal string with a internal buffer of buffersize _buffer = _begin = _end.

virtual ~String ()
StringStorageType storageType () const throw ()
CharacterClass characterClass () const throw ()
CodePage codePage () const throw ()
StringFlags characterEncoding () const throw ()
StringFlags stringFlags () const throw ()
bool isCharacterClass (CharacterClass cc) const throw ()
byte_iterator buffer () const throw ()
byte_iterator byte_begin () const throw ()
byte_iterator byte_end () const throw ()
int bufferLength () const throw ()
 returns the length of the stored bytes (not character)

iterator begin () const
iterator end () const
void _set (int flags, byte *buffer, int bufs, byte_iterator b, byte_iterator e)
void _setEnd (byte_iterator e)
RString toString ()
 return a string representation of this object Object::toString() return getName() by default

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

RObject clone ()
 reimplemented from Object

bool equals (IN(RObject) o)
 return false if object is not a string instance, or string does not have same content

bool equals (IN(RString) str)
bool equals (const char *cstr)
 compare with null terminated native string

bool equals (const char *cstr, int len)
 compare with native string on given length

bool equalsWithHash (const char *cstr, int hashCode)
 if given hasCode is not equal to hashCode of this string return false, othewise use equals()

bool equalsWithHash (const char *cstr, int len, int hashCode)
 if given hasCode is not equal to hashCode of this string return false, othewise use equals()

bool equals (const StaticAsciiLiteral &slit)
 if given hasCode is not equal to hashCode of this string return false, othewise use equals()

bool equals (const uc2char *cstr)
 compare with null terminated native string

bool equals (const String &str)
bool equalsNoHash (const String &str)
 traditional hashing

bool equalsIgnoreCase (IN(RString) other) const
 compare 2 string ignore case.

bool equalsIgnoreCase (const char *other) const
 compare 2 string ignore case.

bool equalsIgnoreCase (const uc2char *other) const
 compare 2 string ignore case.

bool equalsIgnoreCase (const String &o) const
int compareTo (IN(RObject) o)
 API: JDK / reimplemented from Object.

int compareTo (IN(RString) s)
 compare two string lexically.

int compareTo (const char *cstr)
 compare two string lexically.

int compareTo (const uc2char *cstr)
 compare two string lexically.

int compareTo (const String &other)
int compareToIgnoreCase (const String &other) const
int compareToIgnoreCase (IN(RString) other) const
 compare two string lexically.

int compareToIgnoreCase (const char *other) const
 compare two string lexically.

int compareToIgnoreCase (const uc2char *other) const
 compare two string lexically.

uc2char charAt (int idx) const
 return character at given offset
Exceptions:
StringIndexOutOfBoundsException 



int hashCode ()
 return the hash code of this string the String does cache the hash code for performance reasons

int length () const
 return the count of contained characters

const char * c_str () const
 return the underlying character stream throws exception if not compatible stream

const uc2charuc2c_str () const
 return the underlying character stream throws exception if not compatible stream

const uc2charnative_c_str () const
RString concat (IN(RString) o) const
 Append param o to this string an return the concated string.

RString concat (const String &str) const
RString concat (const char *str) const
RString concat (const uc2char *str) const
bool startsWith (IN(RString) prefix, int toffset=0) const
 return true if prefix starts at offset of this string

bool startsWith (const char *prefix, int toffset=0) const
bool startsWith (const uc2char *prefix, int toffset=0) const
bool startsWith (const String &prefix, int toffset=0) const
bool endsWith (IN(RString) suffix) const
 return true if this string ends with suffix string

bool endsWith (const char *text) const
bool endsWith (const uc2char *text) const
bool endsWith (const String &suffix) const
bool regionMatches (int toffset, IN(RString) other, int otheroffset=0, int len=-1, bool ignoreCase=false) const
bool regionMatches (int toffset, const char *other, int otheroffset=0, int len=-1, bool ignoreCase=false) const
bool regionMatches (int toffset, const uc2char *other, int otheroffset=0, int len=-1, bool ignoreCase=false) const
bool regionMatches (int toffset, const String &other, int otheroffset=0, int len=-1, bool ignoreCase=false) const
int indexOf (char ch, int fromIndex=0) const
 Search an character in this string starting at fromIndex.

int indexOf (uc2char ch, int fromIndex=0) const
 Search an character in this string starting at fromIndex.

int lastIndexOf (char ch, int fromIndex=-1) const
 Search an character from back in this string starting at fromIndex.

int lastIndexOf (uc2char ch, int fromIndex=-1) const
int indexOf (IN(RString) str, int fromIndex=0) const
 Find sub string in this string starting at fromIndex.

int indexOf (const char *str, int fromIndex=0) const
int indexOf (const uc2char *str, int fromIndex=0) const
int indexOf (const String &str, int fromIndex=0) const
int lastIndexOf (IN(RString) str, int fromIndex=-1) const
 Find substring from back in this string.

int lastIndexOf (const char *str, int fromIndex=-1) const
int lastIndexOf (const uc2char *str, int fromIndex=-1) const
int lastIndexOf (const String &str, int fromIndex=-1) const
void getChars (int srcBegin, int srcEnd, IN(RcharArray) dst, int dstBegin, IN(acdk::locale::REncoder) enc) const
 copy utf8 stream character into dst

void getUc2Chars (int srcBegin, int srcEnd, IN(RuccharArray) dst, int dstBegin) const
 copy ucchar into dst

RcharArray getChars () const
 The corresponding getByte functions are superflous.

RbyteArray getBytes () const
 return the bytes in current internal encoding

RbyteArray getBytes (IN(RString) enc) const
 return the bytes of this string using the given encoder

RbyteArray getBytes (IN(acdk::locale::REncoder) enc) const
 return the bytes of this string using the given encoder

RcharArray getChars (IN(acdk::locale::REncoder) enc) const
 return the bytes of this string using the given encoder Better to use getBytes()

RuccharArray getUcChars () const
 return the bytes as unicode

RcharArray tocharArray () const
 Does the same as: RcharArray getChars();.

RString substr (int startidx, int endidx=-1) const
 Just an alias to substring().

RString substring (int startidx, int endidx=-1) const
 create a substring of this string.

RString left (int len) const
 return a substring with len characters from left if len > length() return the complete string returns substr(0, len)

RString right (int len) const
 return substring from right if len > length() return the complete string returns substr(len);

RString mid (int start, int len) const
 return a substr(start, start + len) if start > length() return empty string if start + len > length() return substr(start)

RString substringBefore (IN(RString) find) const
 return the string before the first occourence of find if find is Nil return the this if find cannot be found return this

RString substringAfter (IN(RString) find) const
 return the string after the first found find string if find is Nil return empty string if find cannot be found return empty string if found index + length of find > as length() return empty string

RString substringBeforeLast (IN(RString) find) const
 see substringBefore but relation used lastIndexOf instead of indexOf

RString substringAfterLast (IN(RString) find) const
 see substringAfter but relation used lastIndexOf instead of indexOf

RString toLowerCase () const
 return a new string with lowercase character.

bool isLowerCase () const
 return true, if all character has lowercase or non-letter types

RString toUpperCase () const
 return a new string with upper case character.

bool isUpperCase () const
 return true, if all character has upper case or non-letter types

RString trim (int trimflags=TrimBoth|TrimWhiteSpace) const
 Cut whitespaces from the end of the string.

RString intern () const
 put it into a weak hashmap.

RString replace (char oldChar, char newChar) const
 replaces all appeariances of oldChar with newChar

RString replace (uc2char oldChar, uc2char newChar) const
 unicode variant of character replacemant

RString replace (IN(RString) find, IN(RString) repl) const
 replace every string find with repl string.

RString replace (const char *find, const char *repl) const
RString replace (const uc2char *find, const uc2char *repl) const
RString replace (const String &find, const String &repl) const
RString replace (int startidx, int endidx, IN(RString) str) const
 Cut text from startidx to endix and replace this text with str Different to the other replace function this is (naturally) not recursiv.

RString replace (int startidx, int endidx, const String &str) const
int elementCount (char c) const
 returns how often the caracter can be found in String.

int elementCount (uc2char c) const
int elementCount (IN(RString) str) const
 API: ACDK return how often the string occurs in the String.

int elementCount (const String &str) const
int elementCount (const char *str) const
int elementCount (const uc2char *str) const
int getFirstIndexOf (IN(RString) chars) const
 find the first of one of the chars

RString peekLine (int lineNo) const
 return the nth line of this string

char * c_strdup (sys::Allocator *allocator=0) const
 returns a copy of the String undlying char* buffer.

RString convert (int flags, acdk::locale::CodingErrorAction onMalformed, acdk::locale::CodingErrorAction onUnmappable) const
 convert current string to another CharacterClass

RString convert (int flags) const
 convert the string on given flags.

RString convertToNative () const
 convert string to native underlying operation system calls.

RString narrow () const
 Try to narrow the string to the smallest possible character set.

RString getNormalized () const
 In case this string doesn't own the string buffer (but is substring or a const string, it return a new string which owns the buffer.

RStringArray split () const
 return a StringArray splitted.

RStringArray split (uc2char delimiter) const
 basically calls: StringTokenizer(this, delimiter)->allToken()

RStringArray split (IN(RString) delimiterChars) const
 basically calls: StringTokenizer(this, delimiterChars)->allToken()

RString repeat (int ntimes) const
 repeat this string n times

RString rightPad (int size, uc2char padchar= ' ') const
 padd the this text on the right with paddchar (default is space ' ') if length of this string is less or equal size return this string

RString leftPad (int size, uc2char padchar= ' ') const
 see rightPad

RString center (int size, uc2char padchar= ' ') const
 center this string in screen with size wide

RString operator+ (IN(RString) other) const
RString operator+ (IN(RObject) o) const
RString operator+ (bool v) const
RString operator+ (char v) const
RString operator+ (uc2char v) const
RString operator+ (short v) const
RString operator+ (int v) const
RString operator+ (jlong v) const
RString operator+ (float v) const
RString operator+ (double v) const
RString operator+ (const char *text) const
RString operator+ (char *text) const
RString operator+ (const uc2char *text) const
RString operator+ (uc2char *text) const
bool isCChar () const
 return true if this string holds the characters in 8 bit

bool isUc2Char () const
 return true if this string holds the characters in 16 bit

bool isUc4Char () const
 return true if this string holds the characters in 32 bit

bool isUtf8Char () const
 return true if this string holds the characters in UTF8 encoding (variable bits per character)

int getMaxCharacterSize () const
 return the maximum byte storage for a character may used for buffer allocation

int getCharCapacity () const
 return size of capacity in chars of the underlying string this is not related to length(), may be greater or lesser

void setEnd (byte_iterator it)
String_getSubstrBase () throw ()
 return the real holding substr String instance

const String_getSubstrBase () const throw ()
RString decodeAscUnicode ()
 Asuming in the character are embedded \uABCD token.

RString encodeAscUnicode ()
 encode the current string ascii with \uABCD The resulting string has always the characterClass CCAscii


Static Public Member Functions

RObject create_instance ()
bool isCharacterClass (int flags, CharacterClass cc) throw ()
StringStorageType storageType (StringFlags flags) throw ()
CharacterClass characterClass (StringFlags flags) throw ()
CodePage codePage (StringFlags flags) throw ()
bool hashCodeCompatible (CharacterClass first, CharacterClass second)
 return true if 2 string character classes are hash-compatible

RString copyValueOf (IN(RcharArray) data, int offset=0, int count=-1)
RString valueOf (bool z)
 render the given value to a string

RString valueOf (int z)
 render the given value to a string

RString valueOf (char z)
 render the given value to a string

RString valueOf (uc2char z)
 render the given value to a string

RString valueOf (jlong z)
 render the given value to a string

RString valueOf (float z)
 render the given value to a string

RString valueOf (double z)
 render the given value to a string

RString valueOf (IN(RObject) obj)
 render the given value to a string

RString valueOf (char *ptr)
 render the given value to a string

RString valueOf (const char *ptr)
 render the given value to a string

RString valueOf (uc2char *ptr)
 render the given value to a string

RString valueOf (const uc2char *ptr)
 render the given value to a string

RString valueOf (void *ptr)
 render the given value to a string

RString valueOf (size_t s)
 render the given value to a string

RString valueOf (const String &s)
 render the given value to a string

RString _itoa (int i, int radix)
RString _jltoa (jlong i, int radix)
 OUT (RString) emptyString()
RString getEmptyString ()
 return an empty String

RString defaultString (IN(RString) str)
 return if String is Nil otherwise the String itself

RString defaultString (IN(RString) str, IN(RString) defaultString)
 return defaultString if str is nil otherwise str

bool isEmpty (IN(RString) str)
 return true if str is Nil or length == 0

bool isNotEmpty (IN(RString) str)
 return true if str is not Nil and length > 0

bool isBlank (IN(RString) str)
 return true if str is Nil or empty or all characters of str are white spaces

bool isNotBlank (IN(RString) str)
 return not isBlank(str)

bool isAlpha (IN(RString) str)
 return true if all characters are alph if Nil returns false if string is empty returns true

bool isAlphaSpace (IN(RString) str)
 return true if all characters of str are spaces or letters return false if str is nil return true if str length is 0

bool isAlphanumeric (IN(RString) str)
 return true if all characters of str are letters or numbers return false if str is nil return true if str length is 0

bool isAlphanumericSpace (IN(RString) str)
 return true if all characters of str are letters or numbers or spaces return false if str is nil return true if str length is 0

bool isNumeric (IN(RString) str)
 return true if all characters of str are numbers return false if str is nil return true if str length is 0

bool isNumericSpace (IN(RString) str)
 return true if all characters of str are numbers or white spaces return false if str is nil return true if str length is 0

bool contains (IN(RString) str, uc2char c)
 return false if str is Nil or str->indexOf(c) == -1

bool contains (IN(RString) str, IN(RString) find)
 return false if str is Nil or str->indexOf(find) == -1

bool containsNone (IN(RString) str, IN(RString) chars)
 return true if str or chars is Nil returns true if none of the characters in chars can be found in str otherwise return false

bool containsOnly (IN(RString) str, IN(RString) chars)
 return false if str or chars is Nil return true if in str only characters, which defined in chars

int indexOfAny (IN(RString) str, IN(RuccharArray) chars)
 find the first index of one of the characters if str or chars is Nil return -1 otherwise find the lower index of one of the characters in chars

int indexOfAny (IN(RString) str, IN(RString) chars)
 find the first index of one of the characters in chars if str or chars is Nil return -1 otherwise find the lower index of one of the characters in chars

int indexOfAny (IN(RString) str, IN(RStringArray) strings)
 find the first index of one of the String in strings if str or strings is Nil return -1 otherwise find the lower index of one of the strings

int lastIndexOfAny (IN(RString) str, IN(RString) chars)
 find the last index of chars in str return -1 if str or chars is Nil otherwise return largest index found of one out chars in str if non found return -1

int lastIndexOfAny (IN(RString) str, IN(RuccharArray) chars)
 find the last index of chars in str return -1 if str or chars is Nil otherwise return largest index found of one out chars in str if non found return -1

int lastIndexOfAny (IN(RString) str, IN(RStringArray) strings)
 find the last index of strings in str return -1 if str or strings is Nil otherwise return largest index found of one out strings in str if non found return -1

RString join (IN(acdk::util::RIterator) it)
 concat each element from iterator with character if iterator it is Nil return Nil for each element returned by the iterator toString() will be called if the element is Nil add nothing to the joined string

RString join (IN(acdk::util::RIterator) it, uc2char delimiter)
 concat each element from iterator with character if iterator it is Nil return Nil for each element returned by the iterator toString() will be called if the element is Nil add nothing to the joined At beginning and end are no delimiter

RString join (IN(acdk::util::RIterator) it, IN(RString) delimiter)
RString join (IN(RObjectArray) oa)
 concats each element of the array to a string calls join(oa, String::emptyString()) see join(IN(RObjectArray) oa, IN(RString) delimiter)

RString join (IN(RObjectArray) oa, uc2char delimiter)
 see join(IN(RObjectArray) oa, IN(RString) delimiter)

RString join (IN(RObjectArray) oa, IN(RString) delimiter)
RString deleteWhitespace (IN(RString) str)
 return all whitespace characters from string if str is Nil returns Nil

int indexOfDifference (IN(RString) first, IN(RString) second)
 returns the index position where first differs to second if no difference was found return -1 if first or second is Nil return -1

int getDistance (IN(RString) first, IN(RString) second)
 calculate a distance between 2 string corresponding to the Levenshtein Distance first and second must not Nil The (slitly transformed) code is from (http://www.merriampark.com/ld.htm).

RString fomUtfEscapedLiteral (const char *text)
 Convert string from escaped const char* string, which contains escapes.

RString fomUtfEscapedLiteral (const uc2char *text)
 Convert string from escaped const uc2char* string, which contains escapes.

RString decodeAscUnicode (const char *source, const char *end)
 Convert a ascii stream with utf escape codes use this function only with literal string.

RString decodeAscUnicode (const char *source)
 Convert a ascii stream with utf escape codes use this function only with literal string.

uc2char decodeAscUnicodeCharacter (const char *source)
int calcHashCode (const char *t)
 calculate hascode from 0 terminated string

int calcHashCode (const char *t, int len)
 calculate hascode from string with len

RString _decodeAscUnicode (const char *source, const char *end)
uc2char _decodeAscUnicodeCharacter (const char *source)
void _throwIncompatibleString (const String &s)

Private Member Functions

void _init (const String &str, int start, int end)
 initialization for sub string constructor

void _init (const char *ptr, int length, int flags)
 initialization with ASCII or Ansi stream

void _init (const uc2char *ptr, int length, int flags)
 initialization with UCS-2 stream

char * _init (const uc2char *ptr, int length, const byte *buffer, byte *&end, int targetoffset)
void _init (byte_iterator sit, byte_iterator eit, acdk::locale::Decoder &decoder)
 initialize string with given byte char stream using the decoder

void normalize () const
void _normalize ()
RString _convert (int flags, acdk::locale::CodingErrorAction onMalformed, acdk::locale::CodingErrorAction onUnmappable) const
RString _narrow () const
void _throwIndexOutOfBound (const char *text, int idx, int max)
 Used as optimized version in case target and source has same length.

void _throwIndexOutOfBound (const uc2char *text, int idx, int max)
void _calcHashCode ()

Private Attributes

StringFlags _stringFlags
 a bit combination of StorageType, CharacterClass and CodePage

byte_buffer
 used to store buffer

int _bufferLength
 length of byte buffer

byte_iterator _begin
 first byte char

byte_iterator _end
 byte char behind last char.

int _hashCode
 backuped hasCode


Friends

class StringBuffer


Member Typedef Documentation

typedef byte* acdk::lang::String::byte_iterator
 

standard iterator over single byte chars

typedef int(* acdk::lang::String::CharConvertFunc)(int c)
 

typedef StringIterator acdk::lang::String::iterator
 

typedef unsigned short acdk::lang::String::StringFlags
 


Constructor & Destructor Documentation

acdk::lang::String::String  ) 
 

constructs an empty string

acdk::lang::String::String IN(RString str,
int  start = 0,
int  length = -1
[inline, explicit]
 

Creates a Substring from given str.

Parameters:
str parent string
start byte char position
length of string (endpos = start + offset. if length == -1 until end of parent string

acdk::lang::String::String const String str,
int  start,
int  length = -1
[inline, explicit]
 

Creates a Substring from given str.

Parameters:
start byte char position
end byte char position

acdk::lang::String::String StringBuffer buf,
int  start = 0,
int  end = -1
[explicit]
 

Creates a Substring from given str.

Parameters:
start byte char position
end byte char position

acdk::lang::String::String IN(RStringBuffer buf,
int  start = 0,
int  end = -1
[explicit]
 

Creates a Substring from given str.

Parameters:
start byte char position
end byte char position

acdk::lang::String::String const char *  ptr,
int  flags = ConstSST|CCAscii
[explicit]
 

Create instance of given C-str.

Parameters:
ptr the null terminated C-str.
flags Type to create. Valid types are Normal, Const, Hash Explicit encoding Ascii or Utf can also be provided

acdk::lang::String::String const uc2char ptr,
int  flags = ConstSST|CCUcs2
[explicit]
 

initialize with const wide char character

acdk::lang::String::String const uc4char ptr  ) 
 

initialize with a 4 byte unicode character will be converted to a uc2char internally

acdk::lang::String::String const char *  ptr,
int  length,
int  flags
 

Create instance of given C-str.

Parameters:
ptr the null terminated C-str.
length length of C-string not including ending ''
typ Type to create. Valid types are Normal, Const, Hash Explicit encoding Ascii or Utf can also be provided

acdk::lang::String::String const uc2char ptr,
int  length,
int  flags
 

using wide character to initilize

acdk::lang::String::String IN(RbyteArray ba,
int  offset = 0,
int  size = -1
[explicit]
 

Parameters:
ba contains ASCII or UTF8 stream

acdk::lang::String::String IN(RbyteArray ba,
IN(acdk::locale::RDecoder decoder,
int  offset = 0,
int  size = -1
 

acdk::lang::String::String const byte cptr,
IN(acdk::locale::RDecoder decoder,
int  offset = 0,
int  size = -1
 

acdk::lang::String::String IN(RcharArray ba,
int  offset = 0,
int  size = -1
[explicit]
 

initilize string with UTF8 or ASCII character stream

acdk::lang::String::String IN(RuccharArray ba,
int  offset = 0,
int  size = -1
[explicit]
 

initialize with unicode character array

acdk::lang::String::String byte buffer,
int  bufferlength,
byte_iterator  begin,
byte_iterator  end,
StringFlags  flags
[inline]
 

internal constructor to create string with prepared stream

acdk::lang::String::String const StaticAsciiLiteral strLit  )  [inline]
 

acdk::lang::String::String String parent,
byte_iterator  bit,
byte_iterator  eit
 

Construct a new Substring.

acdk::lang::String::String iterator  begin,
iterator  end
 

creates new string

acdk::lang::String::String int  buffersize  )  [explicit]
 

Constructs a Normal string with a internal buffer of buffersize _buffer = _begin = _end.

Parameters:
buffersize new size of buffer
the type of contained string

virtual acdk::lang::String::~String  )  [virtual]
 


Member Function Documentation

void acdk::lang::String::_calcHashCode  )  [private]
 

RString acdk::lang::String::_convert int  flags,
acdk::locale::CodingErrorAction  onMalformed,
acdk::locale::CodingErrorAction  onUnmappable
const [private]
 

See also:
convert(int flags);

RString acdk::lang::String::_decodeAscUnicode const char *  source,
const char *  end
[static]
 

uc2char acdk::lang::String::_decodeAscUnicodeCharacter const char *  source  )  [static]
 

const String* acdk::lang::String::_getSubstrBase  )  const throw () [inline]
 

String* acdk::lang::String::_getSubstrBase  )  throw () [inline]
 

return the real holding substr String instance

void acdk::lang::String::_init byte_iterator  sit,
byte_iterator  eit,
acdk::locale::Decoder decoder
[private]
 

initialize string with given byte char stream using the decoder

char* acdk::lang::String::_init const uc2char ptr,
int  length,
const byte buffer,
byte *&  end,
int  targetoffset
[private]
 

Parameters:
ptr to concat ucchar string
length length of the ptr
buffer original buffer to append
end iterator set to end of new returned buffer
targetoffset length of orignal buffer
Returns:
new created buffer contains concaned utf string

void acdk::lang::String::_init const uc2char ptr,
int  length,
int  flags
[private]
 

initialization with UCS-2 stream

void acdk::lang::String::_init const char *  ptr,
int  length,
int  flags
[private]
 

initialization with ASCII or Ansi stream

void acdk::lang::String::_init const String str,
int  start,
int  end
[private]
 

initialization for sub string constructor

RString acdk::lang::String::_itoa int  i,
int  radix
[static]
 

RString acdk::lang::String::_jltoa jlong  i,
int  radix
[static]
 

RString acdk::lang::String::_narrow  )  const [private]
 

See also:
naroww()

void acdk::lang::String::_normalize  )  [private]
 

void acdk::lang::String::_set int  flags,
byte buffer,
int  bufs,
byte_iterator  b,
byte_iterator  e
[inline]
 

void acdk::lang::String::_setEnd byte_iterator  e  )  [inline]
 

void acdk::lang::String::_throwIncompatibleString const String s  )  [static]
 

void acdk::lang::String::_throwIndexOutOfBound const uc2char text,
int  idx,
int  max
[private]
 

void acdk::lang::String::_throwIndexOutOfBound const char *  text,
int  idx,
int  max
[private]
 

Used as optimized version in case target and source has same length.

iterator acdk::lang::String::begin  )  const [inline]
 

byte_iterator acdk::lang::String::buffer  )  const throw () [inline]
 

int acdk::lang::String::bufferLength  )  const throw () [inline]
 

returns the length of the stored bytes (not character)

byte_iterator acdk::lang::String::byte_begin  )  const throw () [inline]
 

byte_iterator acdk::lang::String::byte_end  )  const throw () [inline]
 

const char* acdk::lang::String::c_str  )  const
 

return the underlying character stream throws exception if not compatible stream

char* acdk::lang::String::c_strdup sys::Allocator allocator = 0  )  const
 

returns a copy of the String undlying char* buffer.

API: ACDK The copy is allocated via the given allocator. If no allocator is given, the current allocator of String will be used. may throw exception, if not compatible stream

int acdk::lang::String::calcHashCode const char *  t,
int  len
[static]
 

calculate hascode from string with len

int acdk::lang::String::calcHashCode const char *  t  )  [static]
 

calculate hascode from 0 terminated string

RString acdk::lang::String::center int  size,
uc2char  padchar = ' '
const
 

center this string in screen with size wide

CharacterClass acdk::lang::String::characterClass StringFlags  flags  )  throw () [inline, static]
 

CharacterClass acdk::lang::String::characterClass  )  const throw () [inline]
 

StringFlags acdk::lang::String::characterEncoding  )  const throw () [inline]
 

uc2char acdk::lang::String::charAt int  idx  )  const
 

return character at given offset

Exceptions:
StringIndexOutOfBoundsException 

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

reimplemented from Object

Implements acdk::lang::Cloneable.

RObject acdk::lang::String::clone sys::Allocator alc  )  [virtual]
 

reimplemented from Object

Reimplemented from acdk::lang::Cloneable.

CodePage acdk::lang::String::codePage StringFlags  flags  )  throw () [inline, static]
 

CodePage acdk::lang::String::codePage  )  const throw () [inline]
 

int acdk::lang::String::compareTo const String other  ) 
 

int acdk::lang::String::compareTo const uc2char cstr  ) 
 

compare two string lexically.

comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareTo const char *  cstr  ) 
 

compare two string lexically.

comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareTo IN(RString s  )  [inline]
 

compare two string lexically.

comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareTo IN(RObject o  )  [inline, virtual]
 

API: JDK / reimplemented from Object.

Implements acdk::lang::Comparable.

int acdk::lang::String::compareToIgnoreCase const uc2char other  )  const
 

compare two string lexically.

call UnicodeCharacter::compareToIgnoreCase for each character comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareToIgnoreCase const char *  other  )  const
 

compare two string lexically.

call UnicodeCharacter::compareToIgnoreCase for each character comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareToIgnoreCase IN(RString other  )  const [inline]
 

compare two string lexically.

call UnicodeCharacter::compareToIgnoreCase for each character comparison will be done via unicode character number and may not correct for all locals

int acdk::lang::String::compareToIgnoreCase const String other  )  const
 

RString acdk::lang::String::concat const uc2char str  )  const
 

See also:
concat(IN(RString) o) const;

RString acdk::lang::String::concat const char *  str  )  const
 

See also:
concat(IN(RString) o) const;

RString acdk::lang::String::concat const String str  )  const
 

See also:
concat(IN(RString) o) const;

RString acdk::lang::String::concat IN(RString o  )  const [inline]
 

Append param o to this string an return the concated string.

bool acdk::lang::String::contains IN(RString str,
IN(RString find
[inline, static]
 

return false if str is Nil or str->indexOf(find) == -1

bool acdk::lang::String::contains IN(RString str,
uc2char  c
[inline, static]
 

return false if str is Nil or str->indexOf(c) == -1

bool acdk::lang::String::containsNone IN(RString str,
IN(RString chars
[static]
 

return true if str or chars is Nil returns true if none of the characters in chars can be found in str otherwise return false

bool acdk::lang::String::containsOnly IN(RString str,
IN(RString chars
[static]
 

return false if str or chars is Nil return true if in str only characters, which defined in chars

RString acdk::lang::String::convert int  flags  )  const [inline]
 

convert the string on given flags.

Parameters:
flags bitwise combination of CharacterClass and CodePage

RString acdk::lang::String::convert int  flags,
acdk::locale::CodingErrorAction  onMalformed,
acdk::locale::CodingErrorAction  onUnmappable
const [inline]
 

convert current string to another CharacterClass

return this, if string already is this CharacterClass

Parameters:
flags bitwise combination of CharacterClass and CodePage

RString acdk::lang::String::convertToNative  )  const [inline]
 

convert string to native underlying operation system calls.

RString acdk::lang::String::copyValueOf IN(RcharArray data,
int  offset = 0,
int  count = -1
[inline, static]
 

Parameters:
data utf or 7bit ASCII chars

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

Reimplemented from acdk::lang::Object.

RString acdk::lang::String::decodeAscUnicode const char *  source  )  [inline, static]
 

Convert a ascii stream with utf escape codes use this function only with literal string.

RString acdk::lang::String::decodeAscUnicode const char *  source,
const char *  end
[inline, static]
 

Convert a ascii stream with utf escape codes use this function only with literal string.

RString acdk::lang::String::decodeAscUnicode  ) 
 

Asuming in the character are embedded \uABCD token.

uc2char acdk::lang::String::decodeAscUnicodeCharacter const char *  source  )  [inline, static]
 

RString acdk::lang::String::defaultString IN(RString str,
IN(RString defaultString
[inline, static]
 

return defaultString if str is nil otherwise str

RString acdk::lang::String::defaultString IN(RString str  )  [inline, static]
 

return if String is Nil otherwise the String itself

RString acdk::lang::String::deleteWhitespace IN(RString str  )  [static]
 

return all whitespace characters from string if str is Nil returns Nil

int acdk::lang::String::elementCount const uc2char str  )  const
 

See also:
elementCount(IN(RString) str) const;

int acdk::lang::String::elementCount const char *  str  )  const
 

See also:
elementCount(IN(RString) str) const;

int acdk::lang::String::elementCount const String str  )  const
 

See also:
elementCount(IN(RString) str) const;

int acdk::lang::String::elementCount IN(RString str  )  const [inline]
 

API: ACDK return how often the string occurs in the String.

Overlapping strings will not be counted

int acdk::lang::String::elementCount uc2char  c  )  const
 

See also:
elementCount(char c) const;

int acdk::lang::String::elementCount char  c  )  const
 

returns how often the caracter can be found in String.

RString acdk::lang::String::encodeAscUnicode  ) 
 

encode the current string ascii with \uABCD The resulting string has always the characterClass CCAscii

iterator acdk::lang::String::end  )  const [inline]
 

bool acdk::lang::String::endsWith const String suffix  )  const
 

See also:
endsWith(IN(RString) suffix) const;

bool acdk::lang::String::endsWith const uc2char text  )  const
 

See also:
endsWith(IN(RString) suffix) const;

bool acdk::lang::String::endsWith const char *  text  )  const
 

See also:
endsWith(IN(RString) suffix) const;

bool acdk::lang::String::endsWith IN(RString suffix  )  const [inline]
 

return true if this string ends with suffix string

bool acdk::lang::String::equals const String str  )  [inline]
 

bool acdk::lang::String::equals const uc2char cstr  ) 
 

compare with null terminated native string

bool acdk::lang::String::equals const StaticAsciiLiteral slit  )  [inline]
 

if given hasCode is not equal to hashCode of this string return false, othewise use equals()

bool acdk::lang::String::equals const char *  cstr,
int  len
 

compare with native string on given length

bool acdk::lang::String::equals const char *  cstr  ) 
 

compare with null terminated native string

bool acdk::lang::String::equals IN(RString str  )  [inline]
 

bool acdk::lang::String::equals IN(RObject o  )  [inline, virtual]
 

return false if object is not a string instance, or string does not have same content

Reimplemented from acdk::lang::Object.

bool acdk::lang::String::equalsIgnoreCase const String o  )  const
 

bool acdk::lang::String::equalsIgnoreCase const uc2char other  )  const
 

compare 2 string ignore case.

bool acdk::lang::String::equalsIgnoreCase const char *  other  )  const
 

compare 2 string ignore case.

bool acdk::lang::String::equalsIgnoreCase IN(RString other  )  const [inline]
 

compare 2 string ignore case.

bool acdk::lang::String::equalsNoHash const String str  ) 
 

traditional hashing

bool acdk::lang::String::equalsWithHash const char *  cstr,
int  len,
int  hashCode
[inline]
 

if given hasCode is not equal to hashCode of this string return false, othewise use equals()

bool acdk::lang::String::equalsWithHash const char *  cstr,
int  hashCode
[inline]
 

if given hasCode is not equal to hashCode of this string return false, othewise use equals()

RString acdk::lang::String::fomUtfEscapedLiteral const uc2char text  )  [static]
 

Convert string from escaped const uc2char* string, which contains escapes.

RString acdk::lang::String::fomUtfEscapedLiteral const char *  text  )  [static]
 

Convert string from escaped const char* string, which contains escapes.

RbyteArray acdk::lang::String::getBytes IN(acdk::locale::REncoder enc  )  const
 

return the bytes of this string using the given encoder

RbyteArray acdk::lang::String::getBytes IN(RString enc  )  const
 

return the bytes of this string using the given encoder

RbyteArray acdk::lang::String::getBytes  )  const
 

return the bytes in current internal encoding

int acdk::lang::String::getCharCapacity  )  const
 

return size of capacity in chars of the underlying string this is not related to length(), may be greater or lesser

RcharArray acdk::lang::String::getChars IN(acdk::locale::REncoder enc  )  const
 

return the bytes of this string using the given encoder Better to use getBytes()

RcharArray acdk::lang::String::getChars  )  const
 

The corresponding getByte functions are superflous.

my throw exception if underlying CharacterClass is not compatible

void acdk::lang::String::getChars int  srcBegin,
int  srcEnd,
IN(RcharArray dst,
int  dstBegin,
IN(acdk::locale::REncoder enc
const
 

copy utf8 stream character into dst

Parameters:
srcBegin byte offset
srsEnd byte offset

int acdk::lang::String::getDistance IN(RString first,
IN(RString second
[static]
 

calculate a distance between 2 string corresponding to the Levenshtein Distance first and second must not Nil The (slitly transformed) code is from (http://www.merriampark.com/ld.htm).

RString acdk::lang::String::getEmptyString  )  [inline, static]
 

return an empty String

int acdk::lang::String::getFirstIndexOf IN(RString chars  )  const
 

find the first of one of the chars

Parameters:
chars list of character to find
Returns:
-1 if not found, otherwise the first char of chars

int acdk::lang::String::getMaxCharacterSize  )  const [inline]
 

return the maximum byte storage for a character may used for buffer allocation

RString acdk::lang::String::getNormalized  )  const
 

In case this string doesn't own the string buffer (but is substring or a const string, it return a new string which owns the buffer.

Otherwise just return itself.

void acdk::lang::String::getUc2Chars int  srcBegin,
int  srcEnd,
IN(RuccharArray dst,
int  dstBegin
const
 

copy ucchar into dst

Parameters:
srcBegin unicode offset
srcEnd unicode offset

RuccharArray acdk::lang::String::getUcChars  )  const
 

return the bytes as unicode

int acdk::lang::String::hashCode  )  [inline, virtual]
 

return the hash code of this string the String does cache the hash code for performance reasons

Reimplemented from acdk::lang::Object.

bool acdk::lang::String::hashCodeCompatible CharacterClass  first,
CharacterClass  second
[inline, static]
 

return true if 2 string character classes are hash-compatible

int acdk::lang::String::indexOf const String str,
int  fromIndex = 0
const
 

See also:
indexOf(IN(RString) str, int fromIndex = 0) const;

int acdk::lang::String::indexOf const uc2char str,
int  fromIndex = 0
const
 

See also:
indexOf(IN(RString) str, int fromIndex = 0) const;

int acdk::lang::String::indexOf const char *  str,
int  fromIndex = 0
const
 

See also:
indexOf(IN(RString) str, int fromIndex = 0) const;

int acdk::lang::String::indexOf IN(RString str,
int  fromIndex = 0
const [inline]
 

Find sub string in this string starting at fromIndex.

Parameters:
str substring
fromIndex left position in this string where to start to search
Returns:
-1 if not found otherwise index position of left start of substring

int acdk::lang::String::indexOf uc2char  ch,
int  fromIndex = 0
const
 

Search an character in this string starting at fromIndex.

int acdk::lang::String::indexOf char  ch,
int  fromIndex = 0
const
 

Search an character in this string starting at fromIndex.

int acdk::lang::String::indexOfAny IN(RString str,
IN(RStringArray strings
[static]
 

find the first index of one of the String in strings if str or strings is Nil return -1 otherwise find the lower index of one of the strings

int acdk::lang::String::indexOfAny IN(RString str,
IN(RString chars
[static]
 

find the first index of one of the characters in chars if str or chars is Nil return -1 otherwise find the lower index of one of the characters in chars

int acdk::lang::String::indexOfAny IN(RString str,
IN(RuccharArray chars
[static]
 

find the first index of one of the characters if str or chars is Nil return -1 otherwise find the lower index of one of the characters in chars

int acdk::lang::String::indexOfDifference IN(RString first,
IN(RString second
[static]
 

returns the index position where first differs to second if no difference was found return -1 if first or second is Nil return -1

RString acdk::lang::String::intern  )  const
 

put it into a weak hashmap.

interned Strings are usefull, if many equal strings are created (f.e. in XML dom's)

bool acdk::lang::String::isAlpha IN(RString str  )  [static]
 

return true if all characters are alph if Nil returns false if string is empty returns true

bool acdk::lang::String::isAlphanumeric IN(RString str  )  [static]
 

return true if all characters of str are letters or numbers return false if str is nil return true if str length is 0

bool acdk::lang::String::isAlphanumericSpace IN(RString str  )  [static]
 

return true if all characters of str are letters or numbers or spaces return false if str is nil return true if str length is 0

bool acdk::lang::String::isAlphaSpace IN(RString str  )  [static]
 

return true if all characters of str are spaces or letters return false if str is nil return true if str length is 0

bool acdk::lang::String::isBlank IN(RString str  )  [static]
 

return true if str is Nil or empty or all characters of str are white spaces

bool acdk::lang::String::isCChar  )  const [inline]
 

return true if this string holds the characters in 8 bit

bool acdk::lang::String::isCharacterClass int  flags,
CharacterClass  cc
throw () [inline, static]
 

bool acdk::lang::String::isCharacterClass CharacterClass  cc  )  const throw () [inline]
 

bool acdk::lang::String::isEmpty IN(RString str  )  [inline, static]
 

return true if str is Nil or length == 0

bool acdk::lang::String::isLowerCase  )  const
 

return true, if all character has lowercase or non-letter types

bool acdk::lang::String::isNotBlank IN(RString str  )  [inline, static]
 

return not isBlank(str)

bool acdk::lang::String::isNotEmpty IN(RString str  )  [inline, static]
 

return true if str is not Nil and length > 0

bool acdk::lang::String::isNumeric IN(RString str  )  [static]
 

return true if all characters of str are numbers return false if str is nil return true if str length is 0

bool acdk::lang::String::isNumericSpace IN(RString str  )  [static]
 

return true if all characters of str are numbers or white spaces return false if str is nil return true if str length is 0

bool acdk::lang::String::isUc2Char  )  const [inline]
 

return true if this string holds the characters in 16 bit

bool acdk::lang::String::isUc4Char  )  const [inline]
 

return true if this string holds the characters in 32 bit

bool acdk::lang::String::isUpperCase  )  const
 

return true, if all character has upper case or non-letter types

bool acdk::lang::String::isUtf8Char  )  const [inline]
 

return true if this string holds the characters in UTF8 encoding (variable bits per character)

RString acdk::lang::String::join IN(RObjectArray oa,
IN(RString delimiter
[static]
 

RString acdk::lang::String::join IN(RObjectArray oa,
uc2char  delimiter
[static]
 

see join(IN(RObjectArray) oa, IN(RString) delimiter)

RString acdk::lang::String::join IN(RObjectArray oa  )  [static]
 

concats each element of the array to a string calls join(oa, String::emptyString()) see join(IN(RObjectArray) oa, IN(RString) delimiter)

RString acdk::lang::String::join IN(acdk::util::RIterator it,
IN(RString delimiter
[static]
 

RString acdk::lang::String::join IN(acdk::util::RIterator it,
uc2char  delimiter
[static]
 

concat each element from iterator with character if iterator it is Nil return Nil for each element returned by the iterator toString() will be called if the element is Nil add nothing to the joined At beginning and end are no delimiter

RString acdk::lang::String::join IN(acdk::util::RIterator it  )  [static]
 

concat each element from iterator with character if iterator it is Nil return Nil for each element returned by the iterator toString() will be called if the element is Nil add nothing to the joined string

At beginning and end are no delimiter

int acdk::lang::String::lastIndexOf const String str,
int  fromIndex = -1
const
 

See also:
lastIndexOf(IN(RString) str, int fromIndex = -1) const;

int acdk::lang::String::lastIndexOf const uc2char str,
int  fromIndex = -1
const
 

See also:
lastIndexOf(IN(RString) str, int fromIndex = -1) const;

int acdk::lang::String::lastIndexOf const char *  str,
int  fromIndex = -1
const
 

See also:
lastIndexOf(IN(RString) str, int fromIndex = -1) const;

int acdk::lang::String::lastIndexOf IN(RString str,
int  fromIndex = -1
const [inline]
 

Find substring from back in this string.

Parameters:
str substring to search
fromIndex right position in this string where to start search if fromIndex == -1 search from end of this string
Returns:
-1 if substring cannot be found in this string. Otherwise index position of substring in this string

int acdk::lang::String::lastIndexOf uc2char  ch,
int  fromIndex = -1
const
 

See also:
lastIndexOf(char ch, int fromIndex = -1) const;

int acdk::lang::String::lastIndexOf char  ch,
int  fromIndex = -1
const
 

Search an character from back in this string starting at fromIndex.

Parameters:
fromIndex right position where to start. if fromIndex == -1 start searching from end of this string
Returns:
-1 if character cannot be not found

int acdk::lang::String::lastIndexOfAny IN(RString str,
IN(RStringArray strings
[static]
 

find the last index of strings in str return -1 if str or strings is Nil otherwise return largest index found of one out strings in str if non found return -1

int acdk::lang::String::lastIndexOfAny IN(RString str,
IN(RuccharArray chars
[static]
 

find the last index of chars in str return -1 if str or chars is Nil otherwise return largest index found of one out chars in str if non found return -1

int acdk::lang::String::lastIndexOfAny IN(RString str,
IN(RString chars
[static]
 

find the last index of chars in str return -1 if str or chars is Nil otherwise return largest index found of one out chars in str if non found return -1

RString acdk::lang::String::left int  len  )  const [inline]
 

return a substring with len characters from left if len > length() return the complete string returns substr(0, len)

RString acdk::lang::String::leftPad int  size,
uc2char  padchar = ' '
const
 

see rightPad

int acdk::lang::String::length  )  const
 

return the count of contained characters

RString acdk::lang::String::mid int  start,
int  len
const [inline]
 

return a substr(start, start + len) if start > length() return empty string if start + len > length() return substr(start)

RString acdk::lang::String::narrow  )  const [inline]
 

Try to narrow the string to the smallest possible character set.

If string cannot be narrowed, it just return this string

const uc2char* acdk::lang::String::native_c_str  )  const [inline]
 

void acdk::lang::String::normalize  )  const [inline, private]
 

RString acdk::lang::String::operator+ uc2char text  )  const
 

RString acdk::lang::String::operator+ const uc2char text  )  const
 

RString acdk::lang::String::operator+ char *  text  )  const [inline]
 

RString acdk::lang::String::operator+ const char *  text  )  const [inline]
 

RString acdk::lang::String::operator+ double  v  )  const
 

RString acdk::lang::String::operator+ float  v  )  const
 

RString acdk::lang::String::operator+ jlong  v  )  const
 

RString acdk::lang::String::operator+ int  v  )  const
 

RString acdk::lang::String::operator+ short  v  )  const
 

RString acdk::lang::String::operator+ uc2char  v  )  const
 

RString acdk::lang::String::operator+ char  v  )  const
 

RString acdk::lang::String::operator+ bool  v  )  const
 

RString acdk::lang::String::operator+ IN(RObject o  )  const
 

RString acdk::lang::String::operator+ IN(RString other  )  const
 

acdk::lang::String::OUT RString   )  [static]
 

RString acdk::lang::String::peekLine int  lineNo  )  const
 

return the nth line of this string

Parameters:
lineNo line number starting with 0
Returns:
Nil if no line was found or lineNo is < 0

bool acdk::lang::String::regionMatches int  toffset,
const String other,
int  otheroffset = 0,
int  len = -1,
bool  ignoreCase = false
const
 

See also:
regionMatches(int toffset, IN(RString) other, int otheroffset = 0, int len = -1, bool ignoreCase = false) const;

bool acdk::lang::String::regionMatches int  toffset,
const uc2char other,
int  otheroffset = 0,
int  len = -1,
bool  ignoreCase = false
const
 

See also:
regionMatches(int toffset, IN(RString) other, int otheroffset = 0, int len = -1, bool ignoreCase = false) const;

bool acdk::lang::String::regionMatches int  toffset,
const char *  other,
int  otheroffset = 0,
int  len = -1,
bool  ignoreCase = false
const
 

See also:
regionMatches(int toffset, IN(RString) other, int otheroffset = 0, int len = -1, bool ignoreCase = false) const;

bool acdk::lang::String::regionMatches int  toffset,
IN(RString other,
int  otheroffset = 0,
int  len = -1,
bool  ignoreCase = false
const [inline]
 

Parameters:
toffset character offset of this string
other check if other is part of this string
len character length to compare. If len == -1 compare length of other
ignoreCase if true ignore case sensitivity

RString acdk::lang::String::repeat int  ntimes  )  const
 

repeat this string n times

RString acdk::lang::String::replace int  startidx,
int  endidx,
const String str
const
 

RString acdk::lang::String::replace int  startidx,
int  endidx,
IN(RString str
const [inline]
 

Cut text from startidx to endix and replace this text with str Different to the other replace function this is (naturally) not recursiv.

uses byte offsets

RString acdk::lang::String::replace const String find,
const String repl
const
 

See also:
replace(IN(RString) find, IN(RString) repl) const;

RString acdk::lang::String::replace const uc2char find,
const uc2char repl
const
 

See also:
replace(IN(RString) find, IN(RString) repl) const;

RString acdk::lang::String::replace const char *  find,
const char *  repl
const
 

See also:
replace(IN(RString) find, IN(RString) repl) const;

RString acdk::lang::String::replace IN(RString find,
IN(RString repl
const [inline]
 

replace every string find with repl string.

If find string cannot be found this will be returned otherwise a new created string.

RString acdk::lang::String::replace uc2char  oldChar,
uc2char  newChar
const
 

unicode variant of character replacemant

RString acdk::lang::String::replace char  oldChar,
char  newChar
const
 

replaces all appeariances of oldChar with newChar

RString acdk::lang::String::right int  len  )  const [inline]
 

return substring from right if len > length() return the complete string returns substr(len);

RString acdk::lang::String::rightPad int  size,
uc2char  padchar = ' '
const
 

padd the this text on the right with paddchar (default is space ' ') if length of this string is less or equal size return this string

void acdk::lang::String::setEnd byte_iterator  it  )  [inline]
 

RStringArray acdk::lang::String::split IN(RString delimiterChars  )  const
 

basically calls: StringTokenizer(this, delimiterChars)->allToken()

RStringArray acdk::lang::String::split uc2char  delimiter  )  const
 

basically calls: StringTokenizer(this, delimiter)->allToken()

RStringArray acdk::lang::String::split  )  const
 

return a StringArray splitted.

basically calls: StringTokenizer(this)->allToken()

bool acdk::lang::String::startsWith const String prefix,
int  toffset = 0
const
 

See also:
startsWith(IN(RString) prefix, int toffset = 0) const;

bool acdk::lang::String::startsWith const uc2char prefix,
int  toffset = 0
const
 

See also:
startsWith(IN(RString) prefix, int toffset = 0) const;

bool acdk::lang::String::startsWith const char *  prefix,
int  toffset = 0
const
 

See also:
startsWith(IN(RString) prefix, int toffset = 0) const;

bool acdk::lang::String::startsWith IN(RString prefix,
int  toffset = 0
const [inline]
 

return true if prefix starts at offset of this string

Parameters:
prefix string
toffset character offset

StringStorageType acdk::lang::String::storageType StringFlags  flags  )  throw () [inline, static]
 

StringStorageType acdk::lang::String::storageType  )  const throw () [inline]
 

StringFlags acdk::lang::String::stringFlags  )  const throw () [inline]
 

RString acdk::lang::String::substr int  startidx,
int  endidx = -1
const
 

Just an alias to substring().

See also:
substring(int startidx, int endidx = -1) const;

RString acdk::lang::String::substring int  startidx,
int  endidx = -1
const [inline]
 

create a substring of this string.

Parameters:
startidx character offset of this string the substring starts
endidx character offset of this string the substring ends or -1 if string should be reach to end of this string length of new string is endidx - startidx

RString acdk::lang::String::substringAfter IN(RString find  )  const
 

return the string after the first found find string if find is Nil return empty string if find cannot be found return empty string if found index + length of find > as length() return empty string

RString acdk::lang::String::substringAfterLast IN(RString find  )  const
 

see substringAfter but relation used lastIndexOf instead of indexOf

RString acdk::lang::String::substringBefore IN(RString find  )  const
 

return the string before the first occourence of find if find is Nil return the this if find cannot be found return this

RString acdk::lang::String::substringBeforeLast IN(RString find  )  const
 

see substringBefore but relation used lastIndexOf instead of indexOf

RcharArray acdk::lang::String::tocharArray  )  const [inline]
 

Does the same as: RcharArray getChars();.

RString acdk::lang::String::toLowerCase  )  const
 

return a new string with lowercase character.

May return this, if this string is always lowercase

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

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

Reimplemented from acdk::lang::Object.

RString acdk::lang::String::toUpperCase  )  const
 

return a new string with upper case character.

May return this, if this string is always upper case

RString acdk::lang::String::trim int  trimflags = TrimBoth|TrimWhiteSpace  )  const
 

Cut whitespaces from the end of the string.

May return this, if no white spaces are cut.

const uc2char* acdk::lang::String::uc2c_str  )  const
 

return the underlying character stream throws exception if not compatible stream

RString acdk::lang::String::valueOf const String s  )  [inline, static]
 

render the given value to a string

RString acdk::lang::String::valueOf size_t  s  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf void *  ptr  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf const uc2char ptr  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf uc2char ptr  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf const char *  ptr  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf char *  ptr  )  [inline, static]
 

render the given value to a string

RString acdk::lang::String::valueOf IN(RObject obj  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf double  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf float  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf jlong  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf uc2char  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf char  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf int  z  )  [static]
 

render the given value to a string

RString acdk::lang::String::valueOf bool  z  )  [static]
 

render the given value to a string


Friends And Related Function Documentation

friend class StringBuffer [friend]
 


Member Data Documentation

byte_iterator acdk::lang::String::_begin [private]
 

first byte char

byte* acdk::lang::String::_buffer [private]
 

used to store buffer

int acdk::lang::String::_bufferLength [private]
 

length of byte buffer

byte_iterator acdk::lang::String::_end [private]
 

byte char behind last char.

if Normal, points to Terminator

int acdk::lang::String::_hashCode [private]
 

backuped hasCode

StringFlags acdk::lang::String::_stringFlags [private]
 

a bit combination of StorageType, CharacterClass and CodePage