bt_xwstring Class Reference
[String Objects]

A Unicode character string class.

#include <bt_xstring.h>

List of all members.

Public Member Functions

const bt_xwstringappend (const BT_UInt16 *p, size_t n)
 Appends a string to this bt_xwstring object.
const bt_xwstringassign (const char *utf8_str)
 Replaces the value of the string object with the value of UTF-8 encoded character string.
const bt_xwstringassign (const BT_UInt16 *str, size_t n)
 Replaces the value of the string object with part of the value of a BT_UInt16 string.
const bt_xwstringassign (const BT_UInt16 *str)
 Replaces the value of the string object with the value of a null-terminated BT_UInt16 string.
const bt_xwstringassign (const bt_xwstring &str)
 Replaces the value of the string object with the value of another string object.
BT_UInt16 at (size_t i) const
 Retrieves a character in a BT_Uint16 string.
BT_UInt16at (size_t i)
 Retrieves a character in a BT_Uint16 string.
 bt_xwstring (const char *utf8_string)
 Constructs a bt_xwstring from a UTF-8 character string.
 bt_xwstring (const BT_UInt16 *s)
 Constructs a bt_xwstring from a null-terminated UTF-16 string.
 bt_xwstring (const BT_UInt16 *s, size_t n)
 Constructs a bt_xwstring from a fixed length UTF-16 string.
 bt_xwstring (const bt_xwstring &other, size_t pos, size_t n=npos)
 Constructs a bt_xwstring from a substring of another bt_xwstring.
 bt_xwstring (const bt_xwstring &other)
 Copy Constructor.
const bt_xwstringbyte_swap ()
 Changes the character byte order of this bt_xwstring object.
const BT_UInt16c_str () const
 Retrieves a pointer to this string's C-style string representation.
size_t capacity () const
 Returns the capacity of this string.
int compare (const bt_xwstring &str) const
 Compares this bt_xwstring object with another string.
size_t copy (BT_UInt16 *p, size_t n, size_t pos=0) const
 Copies a portion of this string into a C-style string.
const BT_UInt16data () const
 Retrieves a pointer to this string's C-style string representation.
bool empty () const
 Determines if this string is empty.
const bt_xwstringerase (size_t i, size_t n=npos)
 Deletes contents of this bt_xwstring object.
const bt_xwstringerase ()
 Deletes the contents of this bt_xwstring object.
size_t find (const bt_xwstring &s, size_t i=0) const
 Finds a string in this bt_xwstring.
const bt_xwstringinsert (size_t pos, const BT_UInt16 *s, size_t n=npos)
 Inserts text into this bt_xwstring.
const bt_xwstringinsert (size_t pos, BT_UInt16 c, size_t n=1)
 Inserts text into this bt_xwstring.
const bt_xwstringinsert (size_t pos, bt_xwstring &s)
 Inserts text into this bt_xwstring.
size_t length () const
 Returns the length of this string.
const bt_xwstringoperator+= (BT_UInt16 c)
 Append operator.
const bt_xwstringoperator+= (const BT_UInt16 *p)
 Append operator.
const bt_xwstringoperator+= (const bt_xwstring &p)
 Append operator.
const bt_xwstringoperator= (const BT_UInt16 *str)
 Replaces the value of the string object with the value of another string object.
const bt_xwstringoperator= (const bt_xwstring &str)
 Replaces the value of the string object with the value of another string object.
BT_UInt16 operator[] (size_t i) const
 Retrieves a character in a BT_Uint16 string.
BT_UInt16operator[] (size_t i)
 Retrieves a character in a BT_Uint16 string.
size_t size () const
 Returns the length of this string.

Static Public Attributes

static const size_t npos
 Represents a missing or unused value.


Constructor & Destructor Documentation

bt_xwstring::bt_xwstring ( const bt_xwstring other  ) 

Copy Constructor

Parameters:
other bt_xwstring from which to construct this one.

bt_xwstring::bt_xwstring ( const bt_xwstring other,
size_t  pos,
size_t  n = npos 
)

Constructs a bt_xwstring from a substring of another bt_xwstring.

Parameters:
other bt_xwstring from which a substring will be used to construct this one.
pos Start position in the source string.
n Number of characters to copy.

bt_xwstring::bt_xwstring ( const BT_UInt16 s,
size_t  n 
)

Constructs a bt_xwstring from a fixed length UTF-16 string.

Parameters:
s Pointer to source UTF-16 string.
n Number of characters to copy into this string.

bt_xwstring::bt_xwstring ( const BT_UInt16 s  ) 

Constructs a bt_xwstring from a null-terminated UTF-16 string.

Parameters:
s Pointer to null-terminated source UTF-16 string.

bt_xwstring::bt_xwstring ( const char *  utf8_string  ) 

Constructs a bt_xwstring from a UTF-8 character string.

Parameters:
utf8_string The source UTF-8 character string.


Member Function Documentation

const bt_xwstring& bt_xwstring::append ( const BT_UInt16 p,
size_t  n 
)

Appends a string to this bt_xwstring object.

Parameters:
p String to append.
n Number of characters to append.
Returns:
A constant reference to this bt_xwstring object.

const bt_xwstring& bt_xwstring::assign ( const char *  utf8_str  ) 

Replaces the value of the string object with the value of UTF-8 encoded character string.

Parameters:
utf8_str The UTF-8 encoded character string to be copied.
Returns:
A constant reference to the modified object.

const bt_xwstring& bt_xwstring::assign ( const BT_UInt16 str,
size_t  n 
)

Replaces the value of the string object with part of the value of a BT_UInt16 string.

Parameters:
str The string object to be copied.
n The number of characters to copy.
Returns:
A constant reference to the modified object.

const bt_xwstring& bt_xwstring::assign ( const BT_UInt16 str  ) 

Replaces the value of the string object with the value of a null-terminated BT_UInt16 string.

Parameters:
str The string object to be copied.
Returns:
A constant reference to the modified object

const bt_xwstring& bt_xwstring::assign ( const bt_xwstring str  ) 

Replaces the value of the string object with the value of another string object.

Parameters:
str The string object to be copied.
Returns:
A constant reference to the modified object

BT_UInt16 bt_xwstring::at ( size_t  i  )  const

Retrieves a character in a BT_Uint16 string.

Parameters:
i The index of the character to retrieve.
Returns:
The character.

BT_UInt16& bt_xwstring::at ( size_t  i  ) 

Retrieves a reference to a character in a BT_Uint16 string.

Parameters:
i The index of the character to retrieve.
Returns:
A reference to the character.

const bt_xwstring& bt_xwstring::byte_swap (  ) 

Changes the character byte order of this bt_xwstring object

Returns:
A constant reference to the modified bt_xwstring object.

const BT_UInt16* bt_xwstring::c_str (  )  const

Retrieves a pointer to this string's C-style string representation.

Returns:
Pointer to the C-style string.

size_t bt_xwstring::capacity (  )  const

Returns the capacity of this string.

Returns:
Capacity of the string.

int bt_xwstring::compare ( const bt_xwstring str  )  const

Compares this bt_xwstring object with another string.

Parameters:
str String to compare.
Returns:
Zero if the strings are identical, <0 if this bt_xwstring object is less than str, or >0 if this bt_xwstring object is greater than str.

size_t bt_xwstring::copy ( BT_UInt16 p,
size_t  n,
size_t  pos = 0 
) const

Copies a portion of this string into a C-style string.

Parameters:
p Pointer to the destination of the copy.
n Number of characgters to copy.
pos Index of the first character to be copied.
Returns:
The character.

const BT_UInt16* bt_xwstring::data (  )  const

Retrieves a pointer to this string's C-style string representation.

Returns:
Pointer to the C-style string.

bool bt_xwstring::empty (  )  const [inline]

Determines if this string is empty.

Returns:
true if the string is empty, false otherwise.

const bt_xwstring& bt_xwstring::erase ( size_t  i,
size_t  n = npos 
)

Deletes contents of this bt_xwstring object.

Parameters:
i Character index where deletion will start.
n Number of characters to delete.
Returns:
A constant reference to this bt_xwstring object.

const bt_xwstring& bt_xwstring::erase (  ) 

Deletes the contents of this bt_xwstring object.

Returns:
A constant reference to this bt_xwstring object.

size_t bt_xwstring::find ( const bt_xwstring s,
size_t  i = 0 
) const

Finds a string in this bt_xwstring.

Parameters:
s String to find.
i Index of the search's starting position.
Returns:
Index of the beginning of the string if found, -1 if the string is not found.

const bt_xwstring& bt_xwstring::insert ( size_t  pos,
const BT_UInt16 s,
size_t  n = npos 
)

Inserts text into this bt_xwstring at the given position.

Parameters:
pos Index of the insertion point.
s Sting to insert
n Number of charaters in the string to copy.
Returns:
A constant reference to the modified bt_xwstring.

const bt_xwstring& bt_xwstring::insert ( size_t  pos,
BT_UInt16  c,
size_t  n = 1 
)

Inserts text into this bt_xwstring at the given postion.

Parameters:
pos Index of the insertion point.
c Character to insert
n Number of occurrences of the character to insert.
Returns:
A constant reference to the modified bt_xwstring.

const bt_xwstring& bt_xwstring::insert ( size_t  pos,
bt_xwstring s 
)

Inserts text into this bt_xwstring at the given position.

Parameters:
pos Index of the insertion point.
s The string to be copied.
Returns:
A constant reference to the modified bt_xwstring.

size_t bt_xwstring::length (  )  const [inline]

Returns the length of this string.

Returns:
Length of the string.

const bt_xwstring& bt_xwstring::operator+= ( BT_UInt16  c  ) 

Append operator.

Parameters:
c Character to append.
Returns:
A constant reference to the modified bt_xwstring.

const bt_xwstring& bt_xwstring::operator+= ( const BT_UInt16 p  ) 

Append operator.

Parameters:
p Pointer to string append.
Returns:
A constant reference to the modified bt_xwstring.

const bt_xwstring& bt_xwstring::operator+= ( const bt_xwstring p  ) 

Append operator.

Parameters:
p bt_xwstring to append.
Returns:
A constant reference to the modified bt_xwstring.

const bt_xwstring& bt_xwstring::operator= ( const BT_UInt16 str  )  [inline]

Replaces the value of the string object with the value of another string object.

Parameters:
str The string object to be copied.
Returns:
A constant reference to the modified object.

const bt_xwstring& bt_xwstring::operator= ( const bt_xwstring str  )  [inline]

Replaces the value of the string object with the value of another string object.

Parameters:
str The string object to be copied.
Returns:
A constant reference to the modified object.

BT_UInt16 bt_xwstring::operator[] ( size_t  i  )  const

Retrieves a character in a BT_Uint16 string.

Parameters:
i The index of the character to retrieve.
Returns:
The character.

BT_UInt16& bt_xwstring::operator[] ( size_t  i  ) 

Retrieves a reference to a character in a BT_Uint16 string.

Parameters:
i The index of the character to retrieve.
Returns:
A reference to the character.

size_t bt_xwstring::size (  )  const

Returns the length of this string.

Returns:
Length of the string.


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

Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.