filters

Swinder::UString Class Reference

#include <ustring.h>

Inherited by Swinder::UConstString [private].

List of all members.


Detailed Description

Unicode string class.

Definition at line 145 of file kspread/excel/sidewinder/ustring.h.


Public Member Functions

 UString ()
 UString (char c)
 UString (UChar c)
 UString (const char *c)
 UString (const UChar *c, int length)
 UString (UChar *c, int length, bool copy)
 UString (const UString &)
 ~UString ()
UStringappend (const UString &)
UStringappend (UChar c)
UStringappend (const char *)
UStringappend (char c)
UStringprepend (const UString &)
UStringprepend (UChar c)
UStringprepend (const char *)
UStringprepend (char c)
char * ascii () const
UStringoperator= (const char *c)
UStringoperator= (const UString &)
UStringoperator+= (const UString &s)
const UChardata () const
bool isNull () const
bool isEmpty () const
bool is8Bit () const
int length () const
void truncate (int n)
int capacity () const
void reserve (int r)
UChar operator[] (int pos) const
UCharReference operator[] (int pos)
UString substr (int pos=0, int len=-1) const
int find (const UString &f, int pos=0) const

Static Public Member Functions

static UString number (int i)
static UString number (unsigned int u)
static UString number (double d)

Static Public Attributes

static UString null

Friends

class UCharReference
class UConstString
bool operator== (const UString &, const UString &)

Constructor & Destructor Documentation

UString::UString (  ) 

Constructs a null string.

Definition at line 98 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( char  c  )  [explicit]

Constructs a string from the single character c.

Definition at line 104 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( UChar  c  )  [explicit]

Constructs a string from the single character c.

Definition at line 111 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( const char *  c  )  [explicit]

Constructs a string from a classical zero determined char string.

Definition at line 118 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( const UChar c,
int  length 
)

Constructs a string from an array of Unicode characters of the specified length.

Definition at line 124 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( UChar c,
int  length,
bool  copy 
)

If copy is false a shallow copy of the string will be created.

That means that the data will NOT be copied and you'll have to guarantee that it doesn't get deleted during the lifetime of the UString object.

Definition at line 131 of file kspread/excel/sidewinder/ustring.cpp.

UString::UString ( const UString b  ) 

Copy constructor.

Makes a shallow copy only.

Definition at line 142 of file kspread/excel/sidewinder/ustring.cpp.

UString::~UString (  ) 

Destructor.

If this handle was the only one holding a reference to the string the data will be freed.

Definition at line 153 of file kspread/excel/sidewinder/ustring.cpp.


Member Function Documentation

UString UString::number ( int  i  )  [static]

Constructs a string from an int.

Definition at line 158 of file kspread/excel/sidewinder/ustring.cpp.

UString UString::number ( unsigned int  u  )  [static]

Constructs a string from an unsigned int.

Definition at line 206 of file kspread/excel/sidewinder/ustring.cpp.

UString UString::number ( double  d  )  [static]

Constructs a string from a floating-point value.

Definition at line 248 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::append ( const UString t  ) 

Append another string.

Definition at line 277 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::append ( UChar  c  ) 

Append a character.

Definition at line 319 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::append ( const char *  s  ) 

Append zero-terminated string.

Definition at line 297 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::append ( char  c  ) 

Append a single character.

Definition at line 337 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::prepend ( const UString t  ) 

Prepend another string.

Definition at line 343 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::prepend ( UChar  c  ) 

Prepend a character.

Definition at line 388 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::prepend ( const char *  s  ) 

Prepend zero-terminated string.

Definition at line 365 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::prepend ( char  c  ) 

Prepend a single character.

Definition at line 406 of file kspread/excel/sidewinder/ustring.cpp.

char * UString::ascii (  )  const

Convert the Unicode string to plain ASCII chars chopping of any higher bytes.

This method should only be used for *debugging* purposes as it is neither Unicode safe nor free from side effects. In order not to waste any memory the char buffer is static and *shared* by all UString instances.

Definition at line 411 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::operator= ( const char *  c  ) 

Assignment operator.

Definition at line 424 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::operator= ( const UString str  ) 

Assignment operator.

Definition at line 436 of file kspread/excel/sidewinder/ustring.cpp.

UString & UString::operator+= ( const UString s  ) 

Appends the specified string.

Definition at line 445 of file kspread/excel/sidewinder/ustring.cpp.

const UChar* Swinder::UString::data (  )  const [inline]

Returns:
A pointer to the internal Unicode data.

Definition at line 281 of file kspread/excel/sidewinder/ustring.h.

bool Swinder::UString::isNull (  )  const [inline]

Returns:
True if null.

Definition at line 285 of file kspread/excel/sidewinder/ustring.h.

bool Swinder::UString::isEmpty (  )  const [inline]

Returns:
True if null or zero length.

Definition at line 289 of file kspread/excel/sidewinder/ustring.h.

bool UString::is8Bit (  )  const

Use this if you want to make sure that this string is a plain ASCII string.

For example, if you don't want to lose any information when using ascii().

Returns:
True if the string doesn't contain any non-ASCII characters.

Definition at line 450 of file kspread/excel/sidewinder/ustring.cpp.

int Swinder::UString::length (  )  const [inline]

Returns:
The length of the string.

Definition at line 301 of file kspread/excel/sidewinder/ustring.h.

void UString::truncate ( int  n  ) 

Truncates the string to n.

Nothing happens if n > length().

Definition at line 256 of file kspread/excel/sidewinder/ustring.cpp.

int Swinder::UString::capacity (  )  const [inline]

Returns:
The reserved capacity of the string.

Definition at line 311 of file kspread/excel/sidewinder/ustring.h.

void UString::reserve ( int  r  ) 

Reserves room for the string, useful to speed up append().

Definition at line 265 of file kspread/excel/sidewinder/ustring.cpp.

UChar UString::operator[] ( int  pos  )  const

Const character at specified position.

Definition at line 460 of file kspread/excel/sidewinder/ustring.cpp.

UCharReference UString::operator[] ( int  pos  ) 

Writable reference to character at specified position.

Definition at line 468 of file kspread/excel/sidewinder/ustring.cpp.

UString UString::substr ( int  pos = 0,
int  len = -1 
) const

Returns:
The sub string starting at position pos and length len.

Definition at line 474 of file kspread/excel/sidewinder/ustring.cpp.

int UString::find ( const UString f,
int  pos = 0 
) const

Returns:
Position of first occurence of f starting at position pos. -1 if the search was not successful.

Definition at line 495 of file kspread/excel/sidewinder/ustring.cpp.


Member Data Documentation

Static instance of a null string.

Definition at line 341 of file kspread/excel/sidewinder/ustring.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys