#include <bt_xstring.h>
Public Member Functions | |
const bt_xstring & | append (const char *p, size_t n) |
Appends a character string. | |
const bt_xstring & | assign (const BT_UInt16 *str, size_t n) |
Replaces the value of the string object with the value of a fixed length UTF-16 string. | |
const bt_xstring & | assign (const char *str, size_t n) |
Replaces the value of the string object with the value of a fixed length character string. | |
const bt_xstring & | assign (const char *str) |
Replaces the value of the string object with the value of a null-terminated character string. | |
const bt_xstring & | assign (const bt_xstring &str) |
Replaces the value the string object with the value of another string object. | |
char | at (size_t i) const |
Constant element access. | |
char & | at (size_t i) |
Non-constant element access. | |
bt_xstring (const BT_UInt16 *s) | |
Constructs a bt_xstring object from a null-terminated UTF-16 string. | |
bt_xstring (const char *s) | |
Constructs a bt_xstring object from a null-terminated character string. | |
bt_xstring (const BT_UInt16 *utf16_string, size_t n) | |
Constructs a bt_xstring object from a fixed length UTF-16 string. | |
bt_xstring (const char *s, size_t n) | |
Constructs a bt_xstring object from a fixed length character string. | |
bt_xstring (const bt_xstring &other, size_t pos, size_t n=npos) | |
Constructs a bt_xstring object from a substring of another bt_xstring object. | |
bt_xstring (const bt_xstring &other) | |
Copy constructor. | |
bt_xstring () | |
Default constructor constructs an empty string. | |
const char * | c_str () const |
Converts value of the object to a null-terminated character string. | |
size_t | capacity () const |
Return the capacity of this string. | |
int | compare (const bt_xstring &str) const |
Compares (case-sensitive) this string to another. | |
size_t | copy (char *p, size_t n, size_t pos=0) const |
Copies a portion of the contents of the object. | |
const char * | data () const |
Converts the value of the object to a character string that is not null-terminated. | |
bool | empty () const |
Returns true if string is empty, false otherwise. | |
const bt_xstring & | erase (size_t i, size_t n=npos) |
Deletes string contents. | |
const bt_xstring & | erase () |
Deletes entire string contents. | |
bool | find (char c) const |
Determines if a character exists in this string. | |
size_t | find (const bt_xstring &s, size_t i=0) const |
Finds a string in this one. | |
const bt_xstring & | insert (size_t pos, const char *s, size_t n=npos) |
Inserts a character string. | |
const bt_xstring & | insert (size_t pos, char c, size_t n=1) |
Inserts a character. | |
const bt_xstring & | insert (size_t pos, bt_xstring &p) |
Inserts a bt_xstring. | |
size_t | length () const |
Returns the length of this string. | |
const bt_xstring & | operator+= (char c) |
Append operator. | |
const bt_xstring & | operator+= (const char *p) |
Append operator. | |
const bt_xstring & | operator+= (const bt_xstring &p) |
Append operator. | |
const bt_xstring & | operator= (const char *rhs) |
Replaces the value of the string object with the value of a null-terminated character string. | |
const bt_xstring & | operator= (const bt_xstring &rhs) |
Replaces the value of the string object with the value of another string object. | |
char | operator[] (size_t i) const |
Constant element access. | |
char & | operator[] (size_t i) |
Non-constant element access. | |
size_t | size () const |
Returns the length of this string. | |
~bt_xstring () | |
Destructor. | |
Static Public Attributes | |
static const size_t | npos |
Represents a missing or unused value. |
bt_xstring::bt_xstring | ( | ) |
Default constructor constructs an empty string.
bt_xstring::bt_xstring | ( | const bt_xstring & | other | ) |
Copy constructor.
other | A bt_xstring object. |
bt_xstring::bt_xstring | ( | const bt_xstring & | other, | |
size_t | pos, | |||
size_t | n = npos | |||
) |
Constructs a bt_xstring object from a substring of another bt_xstring object.
other | A bt_xstring object. | |
pos | Index of the beginning of the substring of other to be copied. | |
n | Number of characters to be copied. Default value causes the remainder of the string to be copied. |
bt_xstring::bt_xstring | ( | const char * | s, | |
size_t | n | |||
) |
Constructs a bt_xstring object from a fixed length character string.
s | A character string, not necessarily null-terminated. | |
n | The number of characters to be copied. |
bt_xstring::bt_xstring | ( | const BT_UInt16 * | utf16_string, | |
size_t | n | |||
) |
Constructs a bt_xstring object from a fixed length UTF-16 string.
utf16_string | A character string, not necessarily null-terminated. | |
n | The number of characters to be copied. |
bt_xstring::bt_xstring | ( | const char * | s | ) |
Constructs a bt_xstring object from a null-terminated character string.
s | A null-terminated character string. |
bt_xstring::bt_xstring | ( | const BT_UInt16 * | s | ) |
Constructs a bt_xstring object from a null-terminated UTF-16 string.
s | A null-terminated UTF-16 string. |
bt_xstring::~bt_xstring | ( | ) |
Destructor
Note that this destructor is not virtual. The class is not intended as a base class.
const bt_xstring& bt_xstring::append | ( | const char * | p, | |
size_t | n | |||
) |
Appends a character string.
p | Pointer to string to append. | |
n | Number of characters in the string to append. |
const bt_xstring& bt_xstring::assign | ( | const BT_UInt16 * | str, | |
size_t | n | |||
) |
Replaces the value of the string object with the value of a fixed length UTF-16 string.
str | A UTF-16 string. | |
n | The number of characters to be copied form str. |
const bt_xstring& bt_xstring::assign | ( | const char * | str, | |
size_t | n | |||
) |
Replaces the value of the string object with the value of a fixed length character string.
str | A character string. | |
n | The number of characters to be copied form str. |
const bt_xstring& bt_xstring::assign | ( | const char * | str | ) |
Replaces the value of the string object with the value of a null-terminated character string.
str | A null terminated character string. |
const bt_xstring& bt_xstring::assign | ( | const bt_xstring & | str | ) |
Replaces the value the string object with the value of another string object.
str | The string object to be copied. |
char bt_xstring::at | ( | size_t | i | ) | const |
Constant element access.
i | The zero-based index of a character in the string. |
char& bt_xstring::at | ( | size_t | i | ) |
Non-constant element access.
i | The zero-based index of the character to be modified. |
const char* bt_xstring::c_str | ( | ) | const |
Converts value of the object to a null-terminated character string.
size_t bt_xstring::capacity | ( | ) | const |
Returns the capacity of this string.
int bt_xstring::compare | ( | const bt_xstring & | str | ) | const |
Compares (case-sensitive) this string to another.
str | String with which to compare this one. |
size_t bt_xstring::copy | ( | char * | p, | |
size_t | n, | |||
size_t | pos = 0 | |||
) | const |
Copies a portion of the contents of the object.
p | A pointer to the destination of the copy. | |
n | The maximum number of characters to be copied. | |
pos | The index of the object to begin copying at. |
const char* bt_xstring::data | ( | ) | const |
Converts the value of the object to a character string that is not null-terminated.
bool bt_xstring::empty | ( | ) | const [inline] |
Returns true if string is empty, false otherwise.
const bt_xstring& bt_xstring::erase | ( | size_t | i, | |
size_t | n = npos | |||
) |
Deletes the specified string contents.
i | Start position. | |
n | Number of characters to delete. |
const bt_xstring& bt_xstring::erase | ( | ) |
Deletes entire string contents.
bool bt_xstring::find | ( | char | c | ) | const |
Determines if a given character exists in this string.
c | Character to find. |
size_t bt_xstring::find | ( | const bt_xstring & | s, | |
size_t | i = 0 | |||
) | const |
Finds a string in this one.
s | bt_xstring to find. | |
i | Position from which to begin the search. |
const bt_xstring& bt_xstring::insert | ( | size_t | pos, | |
const char * | s, | |||
size_t | n = npos | |||
) |
Inserts a character string at the given position
pos | Character position where insertion will occur. | |
s | Character string to insert. | |
n | Number of characters in the string to insert. |
const bt_xstring& bt_xstring::insert | ( | size_t | pos, | |
char | c, | |||
size_t | n = 1 | |||
) |
Inserts a character or characters at the given position
pos | Character position where insertion will occur. | |
c | Character to insert. | |
n | Number of occurances of the character to insert. |
const bt_xstring& bt_xstring::insert | ( | size_t | pos, | |
bt_xstring & | p | |||
) |
Inserts a bt_xstring at the given position
pos | Character position where insertion will occur. | |
p | Reference to the bt_xtring to be inserted. |
size_t bt_xstring::length | ( | ) | const [inline] |
Returns length of this string.
const bt_xstring& bt_xstring::operator+= | ( | char | c | ) |
const bt_xstring& bt_xstring::operator+= | ( | const char * | p | ) |
Append operator.
p | character string to append. |
const bt_xstring& bt_xstring::operator+= | ( | const bt_xstring & | p | ) |
const bt_xstring& bt_xstring::operator= | ( | const char * | rhs | ) | [inline] |
Replaces the value of the string object with the value of a null-terminated character string.
rhs | A null-terminated character string. |
const bt_xstring& bt_xstring::operator= | ( | const bt_xstring & | rhs | ) | [inline] |
Replaces the value of the string object with the value of another string object.
rhs | The string object to be copied. |
char bt_xstring::operator[] | ( | size_t | i | ) | const |
Constant element access.
i | The zero-based index of a character in the string. |
char& bt_xstring::operator[] | ( | size_t | i | ) |
Non-constant element access.
i | The zero-based index of the character to be modified. |
size_t bt_xstring::size | ( | ) | const |
Returns length of this string.
Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.