2005/5/9

     
 

acdkstring

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

ACDK String macros/function/classes


Detailed Description

Please refer also to  String.

Classes, functions and macros used to handle Strings.


Compounds

class  RString
 specialization of RefClass1Interface<String, acdk::lang::Object, RComparable> to enable String related operators API: Java
More...

struct  StaticAsciiLiteral
 this is a little helper class for fast comparing String with string literals. More...

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

struct  StringHash
 This template compiles a ascii string literal hash code at up to 20 characters at compile time. More...


Defines

#define RCS(ptr)   ::acdk::lang::constr(ptr)
 ptr is a constant (normally literal) ASCII or UTF byte character stream (const char*) String will not copy this into own buffer, but points to given ptr

#define SCS(ptr)   ::acdk::lang::stkstr(ptr)
 create string of given valid ASCII or UTF8 byte character stream stream.

#define ACDK_STACK_STR(arg)   ::acdk::lang::RString(::acdk::lang::String(arg))
 to wrap a literal on stack with a string Use only if sure that the String (or derived substrings) will only lived in the current stack scope and no reference of the returned string will be stored outside scope

#define _UC(text)   ::acdk::lang::String::decodeAscUnicodeCharacter(text)
 wraps a literal string with embededded unicode escapes

#define _US(text)   ::acdk::lang::String::decodeAscUnicode(text)
 wraps a literal string with embededded unicode escapes an return it as character

#define ASCLITERAL(strlit)   static StaticAsciiLiteral lit_##strlit(#strlit)
 use this if you use a ascii literal in your source code.

#define EXTERN_ASCLITERAL(strlit)   extern acdk::lang::StaticAsciiLiteral lit_##strlit
 same as ASCLITERAL but with extern binding instead of static

#define GLOBAL_ASCLITERAL(strlit)   acdk::lang::StaticAsciiLiteral lit_##strlit(#strlit)
 same as ASCLITERAL but with no binding instead of static

#define EXTERN_EXPORT_ASCLITERAL(Export, strlit)   extern Export acdk::lang::StaticAsciiLiteral lit_##strlit
 same as EXTERN_ASCLITERAL but with DLL export tag

#define EXPORT_ASCLITERAL(Export, strlit)   Export acdk::lang::StaticAsciiLiteral lit_##strlit(#strlit)
 same as GLOBAL_ASCLITERAL but with DLL export tag


Enumerations

enum  StringStorageType {
  UnspecSST = 0x0000, NormalSST = 0x0001, SubSST = 0x0002, ConstSST = 0x0004,
  HashSST = 0x0008, StorageMaskSST = 0x000F
}
 defines how the String class store its internal buffer More...

enum  CharacterClass {
  CCAscii = 0x0010, CCUcs2 = 0x0020, CCUcs4 = 0x0030, CCAnsi = 0x0040,
  CCUtf8 = 0x0050, CCUtf16 = 0x0060, CCOsNative = CCOS_NATIVE, CharacterClassMask = 0x00F0
}
 specifies the encoding of the character buffer More...

enum  CodePage { Ascii_CP = 0x0000, Latin_1_CP = 0x0100, CodePageMask = 0xFF00 }
 ISO code pages supported by string only used if CharacterClass is CCAnsi. More...

enum  TrimFlags {
  TrimSpace = 0x01, TrimNewLines = 0x02, TrimControl = 0x04, TrimWhiteSpace = TrimSpace | TrimNewLines | TrimControl,
  TrimLeft = 0x10, TrimRight = 0x20, TrimBoth = TrimLeft | TrimRight
}
 flags for String::trim More...


Functions

RString constr (const char *ptr)
 creates a const string

RString constr (const uc2char *ptr)
 creates a const string

RString stkstr (const char *ptr)
 ptr is a valid ASCII or UTF8 byte character stream (const char*) String create own buffer

RString stkstr (const uc2char *ptr)
 ptr is a valid UCS-2 character stream (const uc2char*) String create own buffer

RString stkstr (const uc4char *ptr)
 ptr is a valid UCS-4 character stream (const uc4char*) String create own buffer


Define Documentation

#define _UC text   )     ::acdk::lang::String::decodeAscUnicodeCharacter(text)
 

wraps a literal string with embededded unicode escapes

#define _US text   )     ::acdk::lang::String::decodeAscUnicode(text)
 

wraps a literal string with embededded unicode escapes an return it as character

#define ACDK_STACK_STR arg   )     ::acdk::lang::RString(::acdk::lang::String(arg))
 

to wrap a literal on stack with a string Use only if sure that the String (or derived substrings) will only lived in the current stack scope and no reference of the returned string will be stored outside scope

#define ASCLITERAL strlit   )     static StaticAsciiLiteral lit_##strlit(#strlit)
 

use this if you use a ascii literal in your source code.

it declares a static varaible lit_strlit.

Parameters:
lit is the string literal, but without

#define EXPORT_ASCLITERAL Export,
strlit   )     Export acdk::lang::StaticAsciiLiteral lit_##strlit(#strlit)
 

same as GLOBAL_ASCLITERAL but with DLL export tag

#define EXTERN_ASCLITERAL strlit   )     extern acdk::lang::StaticAsciiLiteral lit_##strlit
 

same as ASCLITERAL but with extern binding instead of static

#define EXTERN_EXPORT_ASCLITERAL Export,
strlit   )     extern Export acdk::lang::StaticAsciiLiteral lit_##strlit
 

same as EXTERN_ASCLITERAL but with DLL export tag

#define GLOBAL_ASCLITERAL strlit   )     acdk::lang::StaticAsciiLiteral lit_##strlit(#strlit)
 

same as ASCLITERAL but with no binding instead of static

#define RCS ptr   )     ::acdk::lang::constr(ptr)
 

ptr is a constant (normally literal) ASCII or UTF byte character stream (const char*) String will not copy this into own buffer, but points to given ptr

#define SCS ptr   )     ::acdk::lang::stkstr(ptr)
 

create string of given valid ASCII or UTF8 byte character stream stream.

String create own buffer


Enumeration Type Documentation

enum acdk::lang::CharacterClass
 

specifies the encoding of the character buffer

Enumeration values:
CCAscii  contains 7bit ascii
CCUcs2  contains UCS-2 stream
CCUcs4  contains UCS-4 stream
CCAnsi  contains 8bit character stream, connected with code table in _isoCode
CCUtf8  does not necessarly support indexOf, charAt, replace, etc. operations
CCUtf16  does not necessarly support indexOf, charAt, replace, etc. operations
CCOsNative  type used by underlying os calls
CharacterClassMask 

enum acdk::lang::CodePage
 

ISO code pages supported by string only used if CharacterClass is CCAnsi.

Enumeration values:
Ascii_CP 
Latin_1_CP 
CodePageMask 

enum acdk::lang::StringStorageType
 

defines how the String class store its internal buffer

Enumeration values:
UnspecSST 
NormalSST  normal, means will use normal free store
SubSST  is String from another string.

_buffer contains not the buffer, but the pointer to the underlying String

ConstSST  String has not allocated itself the buffer, just hold it.
HashSST  String is only an entry in a StringTable currently not implemented.
StorageMaskSST 

enum acdk::lang::TrimFlags
 

flags for String::trim

Enumeration values:
TrimSpace  remove Character::isSpace
TrimNewLines  remove '' '
'
TrimControl  Character::isControl.
TrimWhiteSpace 
TrimLeft  trim left side of string
TrimRight  trim right side of string
TrimBoth 


Function Documentation

RString constr const uc2char ptr  )  [inline]
 

creates a const string

Parameters:
ptr is a constant (normally literal) UCS-2 charcter character stream (const uc2char*)

RString constr const char *  ptr  )  [inline]
 

creates a const string

Parameters:
ptr is a constant (normally literal) ASCII or UTF byte character stream (const char*)

RString stkstr const uc4char ptr  )  [inline]
 

ptr is a valid UCS-4 character stream (const uc4char*) String create own buffer

RString stkstr const uc2char ptr  )  [inline]
 

ptr is a valid UCS-2 character stream (const uc2char*) String create own buffer

RString stkstr const char *  ptr  )  [inline]
 

ptr is a valid ASCII or UTF8 byte character stream (const char*) String create own buffer