Xavax C++ Library | Class Index FAQ Overview |
OutOfMemoryException
.
Constructor Summary |
String()
Construct an empty string. |
String(size_t size)
Construct an empty string with an initial capacity of size .
|
String(const String& src)
Construct a new string that is a copy of src .
|
String(const char* s)
Construct a new string with the initial value taken from the null-terminated character string s .
|
String(const char* s, size_t n)
Construct an new string with an initial capacity of n and the initial value taken
from the first n characters of s .
|
Operator Summary | |
String&
|
operator=(const String& src)
Copy the value of src to this object.
|
String&
|
operator=(const char* s)
Copy the string s to this object.
|
String&
|
operator+=(const String& src)
Append the value of src to this object.
|
String&
|
operator+=(const char* s)
Append the string s to this object.
|
String&
|
operator+=(char c)
Append the character c to this object.
|
const char*
|
operator()()
Return the value of this object. |
bool
|
operator==(const String& rhs)
Return true if the value of this object and the value of rhs are equal.
|
bool
|
operator==(const char* rhs)
Return true if the value of this object and the string rhs are equal.
|
bool
|
operator!=(const String& rhs)
Return true if the value of this object and the value of rhs are not equal.
|
bool
|
operator!=(const char* rhs)
Return true if the value of this object and the string rhs are not equal.
|
bool
|
operator<=(const String& rhs)
Return true if the value of this object is less than or equal to the value of rhs .
|
bool
|
operator<=(const char* rhs)
Return true if the value of this object is less than or equal to the string rhs .
|
bool
|
operator>=(const String& rhs)
Return true if the value of this object is greater than or equal to the value of rhs .
|
bool
|
operator>=(const char* rhs)
Return true if the value of this object is greater than or equal to the string rhs .
|
bool
|
operator<(const String& rhs)
Return true if the value of this object is less than the value of rhs .
|
bool
|
operator<(const char* rhs)
Return true if the value of this object is less than the string rhs .
|
bool
|
operator>(const String& rhs)
Return true if the value of this object is greater than the value of rhs .
|
bool
|
operator>(const char* rhs)
Return true if the value of this object is greater than the string rhs .
|
Method Summary | |
void
|
append(char c)
Append character c to the value of this object.
|
void
|
append(const char* s)
Append string s to the value of this object.
|
void
|
append(const char* s, size_t n)
Append the first n characters of string
s to the value of this object.
|
void
|
append(const String& s)
Append the value of s
to the value of this object.
|
void
|
append(const String& s,
size_t n)
Append the first n characters of the value
of object s to the value of this string.
|
void
|
insert(char c, size_t p)
Insert character c into the value of this object
at position p .
|
void
|
insert(const char* s, size_t p)
Insert string s into the value of this object
at position p .
|
void
|
insert(const char* s,
size_t n, size_t p)
Insert the first n characters of string
s into the value of this object
at position p .
|
void
|
insert(const String& s,
size_t p)
Insert the value of s
into the value of this object
at position p .
|
void
|
insert(const String& s,
size_t n, size_t p)
Insert the first n characters of the value
of object s into the value of this string
at position p .
|
size_t
|
length()
Return the length of the string value. |
void
|
replace(char c, size_t p1,
size_t p2)
Replace a substring with the character c .
|
void
|
replace(const char* s, size_t p)
Replace a substring with string s .
|
void
|
replace(const char* s,
size_t n, size_t p)
Replace a substring with the first n characters of string s .
|
void
|
replace(const String& s,
size_t p)
Replace a substring with the value of object s .
|
void
|
replace(const String& s,
size_t n, size_t p)
Replace a substring with the first n characters of the value
of object s .
|
void
|
remove()
Remove a substring from the string. |
void
|
truncate()
Truncate the string to the specified length. |
Methods Inherited From Object | |
cast<T>,
cast<T>,
classRecord,
ClassRecord,
clone,
hashCode
|
Related Classes | |
RCObject, RCPointer. |
Constructor Detail |
String()
OutOfMemoryException
- if sufficient memory cannot be allocated.String(size_t size)
size
.
size
- the initial capacity.OutOfMemoryException
- if sufficient memory cannot be allocated.String(const String& src)
src
- the string to be copied.OutOfMemoryException
- if sufficient memory cannot be allocated.String(const char* s)
s
.
If s
is not null,
the initial capacity is the length of s
plus 1.
s
- the initial string value.OutOfMemoryException
- if sufficient memory cannot be allocated.String(const char* s, size_t size)
n
and the initial value taken
from the first n
characters of s
.
s
- the initial string value.size
- the initial capacity.OutOfMemoryException
- if sufficient memory cannot be allocated.
Operator Detail |
String& operator=(String& src)
src
to this object.
src
- the string to be copied.OutOfMemoryException
- if sufficient memory cannot be allocated.String& operator=(const char* s)
s
to this object.
s
- the string to be copied.OutOfMemoryException
- if sufficient memory cannot be allocated.String& operator+=(String& src)
src
to this object.
src
- the string to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.String& operator+=(const char* s)
s
to this object.
s
- the string to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.String& operator+=(char c)
c
to this object.
c
- the character to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.String& operator()()
bool operator==(const String& rhs)
true
if the value of this
object is equal to the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator==(const char* rhs)
true
if the value of this
object is equal to the string rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator!=(const String& rhs)
true
if the value of this
object is not equal to the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator!=(const char* rhs)
true
if the value of this
object is not equal to the string rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator<=(const String& rhs)
true
if the value of this
object is less than or equal to the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator<=(const char* rhs)
true
if the value of this
object is less than or equal to the string rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator>=(const String& rhs)
true
if the value of this
object is greater than or equal to the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator>=(const char* rhs)
true
if the value of this
object is greater than or equal to the string rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator<(const String& rhs)
true
if the value of this
object is less than the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator<(const char* rhs)
true
if the value of this
object is less than the string rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator>(const String& rhs)
true
if the value of this
object is greater than the value of rhs
.
rhs
- the right operand of the comparison.rhs
.bool operator>(const char* rhs)
true
if the value of this
object is greater than the string rhs
.
rhs
- the right operand of the comparison.rhs
.
Method Detail |
void append(char c)
c
to the value of this object.
c
- the character to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.void append(const char* s)
s
to the value of this object.
s
- the string to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.void append(const char* s, size_t n)
n
characters of the string s
to the value of this object.
s
- the string to be appended.n
- the number of characters to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.void append(const String& s)
s
to the value of this object.
s
- the string to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.void append(const String& s, size_t n)
n
characters
of the value of s
to the value of this object.
s
- the string to be appended.n
- the number of characters to be appended.OutOfMemoryException
- if sufficient memory cannot be allocated.void insert(char c, size_t p)
c
into the value of this object
at position p
.
c
- the character to be inserted.p
- the insertion offset.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void insert(const char* s, size_t p)
s
into the value of this object
at position p
.
s
- the string to be inserted.p
- the insertion offset.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void insert(const char* s, size_t n, size_t p)
n
characters of the string s
into the value of this object at position p
.
s
- the string to be inserted.n
- the number of characters to be inserted.p
- the insertion offset.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void insert(const String& s, size_t p)
s
into the value of this object
at position p
.
s
- the string to be inserted.p
- the insertion offset.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void insert(const String& s, size_t n, size_t p)
n
characters
of the value of s
into the value of this object at position p
.
s
- the string to be inserted.n
- the number of characters to be inserted.p
- the insertion offset.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.size_t length()
void replace(char c, size_t p1, size_t p2)
c
.
c
- the character to be inserted.p1
- the starting position of the substring.p2
- the ending position of the substring.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void replace(const char* s, size_t p1, size_t p2)
s
.
s
- the string to be inserted.p1
- the starting position of the substring.p2
- the ending position of the substring.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void replace(const char* s, size_t n, size_t p1, size_t p2)
n
characters of the string s
.
s
- the string to be inserted.n
- the number of characters to be inserted.p1
- the starting position of the substring.p2
- the ending position of the substring.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void replace(const String& s, size_t p1, size_t p2)
s
.
s
- the string to be inserted.p1
- the starting position of the substring.p2
- the ending position of the substring.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void replace(const String& s, size_t n, size_t p1, size_t p2)
n
characters
of the value of s
.
s
- the string to be inserted.n
- the number of characters to be inserted.p1
- the starting position of the substring.p2
- the ending position of the substring.OutOfMemoryException
- if sufficient memory cannot be allocated.RangeException
- if sufficient memory cannot be allocated.void remove(size_t p1, size_t p2)
p1
- the beginning position.p2
- the ending position.OutOfMemoryException
- if sufficient memory cannot be allocated.void truncate(size_t n)
n
- the new length of the string.OutOfMemoryException
- if sufficient memory cannot be allocated.
Example Code |
Copyright © 2003 Xavax Inc. -- All Rights Reserved