commore
1.0.6-SNAPSHOT
|
#include <String.h>
Classes | |
class | Allocator |
Public Types | |
enum | { STRING_INCREMENT_SIZE = 16 } |
typedef Allocator * | PAllocator |
typedef Char | value_type |
typedef size_t | size_type |
typedef Char & | reference |
typedef const Char & | const_reference |
typedef Char * | pointer |
typedef const Char * | const_pointer |
Public Member Functions | |
String (const String &str) | |
String (const String &str, size_t pos, size_t n=(size_t) npos) | |
String (const Char *str, size_t n) | |
String (const Char *str) | |
String (const AChar *str, size_t n) | |
String (const AChar *str) | |
String (size_t n, Char c) | |
String & | operator= (const String &str) |
String & | operator= (const AChar *str) |
String & | operator= (const Char *str) |
String & | operator= (Char c) |
bool | operator== (const AChar *str) const |
bool | operator== (const String &str) const |
bool | operator== (const Char *str) const |
bool | operator!= (const AChar *str) const |
bool | operator!= (const String &str) const |
bool | operator!= (const Char *str) const |
String & | operator+= (const String &str) |
String | operator+ (const String &str) const |
String & | operator+= (const Char *str) |
String & | operator+= (const AChar *str) |
String & | operator+= (Char c) |
String & | operator+= (AChar c) |
bool | operator< (const String &s) const |
bool | operator> (const String &s) const |
String & | append (const String &str) |
String & | append (const String &str, size_t pos, size_t n) |
String & | append (const Char *str, size_t n) |
String & | append (const AChar *str, size_t n) |
String & | append (const Char *str) |
String & | append (const AChar *str) |
String & | append (size_t n, Char c) |
bool | validate_range (size_t pos, size_t *len) const |
String & | assign (const String &other) |
String & | assign (const String &str, size_t pos, size_t n) |
String & | assign (const Char *str, size_t n) |
String & | assign (const Char *str) |
String & | assign (size_t n, Char c) |
String & | assign (const AChar *str, size_t n) |
String & | assign (const AChar *str) |
String & | assign (size_t n, AChar c) |
void | swap (String &str) |
void | splice (String &str) |
String & | insert (size_t pos1, const String &str) |
String & | insert (size_t pos1, const String &str, size_t pos2, size_t n) |
String & | insert (size_t pos, const Char *str, size_t n) |
String & | insert (size_t pos, const Char *str) |
String & | insert (size_t pos, size_t n, Char c) |
String & | clear () |
String & | erase (size_t pos=0, size_t n=(size_t) npos) |
String & | replace (size_t pos1, size_t n1, const String &str) |
String & | replace (size_t pos1, size_t n1, const String &str, size_t pos2, size_t n2) |
String & | replace (size_t pos, size_t n1, const Char *str, size_t n2) |
String & | replace (size_t pos, size_t n1, const Char *str) |
String & | replace (size_t pos, size_t n1, size_t n2, Char c) |
Char | operator[] (size_t pos) const |
Char & | operator[] (size_t pos) |
Char | at (size_t pos) const |
Char & | at (size_t pos) |
const Char * | c_str () const |
operator const Char * () const | |
const Char * | data () const |
const PAllocator & | get_allocator () const |
size_t | length () const |
size_t | size () const |
size_t | max_size () const |
bool | empty () const |
void | resize (size_t n, Char c) |
void | resize (size_t n) |
size_t | capacity () const |
void | reserve (size_t size) |
size_t | copy (Char *str, size_t n, size_t pos=0) const |
Copy sequence of characters from string Copies a substring of the current value of the string object into the array pointed by s. This substring contains the len characters that start at position pos. The function does not append a null character at the end of the copied content. More... | |
size_t | find (const String &str, size_t pos=0) const |
Find content in string Searches the string for the first occurrence of the sequence specified by its arguments. When pos is specified, the search only includes characters at or after position pos, ignoring any possible occurrences that include characters before pos. Notice that unlike member find_first_of, whenever more than one character is being searched for, it is not enough that just one of these characters match, but the entire sequence must match. More... | |
size_t | find (const Char *s, size_t pos, size_t n) const |
size_t | find (const Char *str, size_t pos=0) const |
size_t | find (Char c, size_t pos=0) const |
size_t | find_first_of (const String &str, size_t pos=0) const |
size_t | find_first_of (const Char *s, size_t pos, size_t n) const |
size_t | find_first_of (const Char *str, size_t pos=0) const |
size_t | find_first_of (Char c, size_t pos=0) const |
size_t | find_first_not_of (const String &str, size_t pos=0) const |
size_t | find_first_not_of (const Char *s, size_t pos, size_t n) const |
size_t | find_first_not_of (Char c, size_t pos=0) const |
size_t | find_first_not_of (const Char *str, size_t pos=0) const |
size_t | rfind (const Char *str, size_t pos, size_t n) const |
size_t | find_last_of (const Char *s, size_t pos, size_t n) const |
size_t | find_last_not_of (const Char *s, size_t pos, size_t n) const |
size_t | rfind (const String &str, size_t pos=(size_t) npos) const |
size_t | rfind (const Char *str, size_t pos=(size_t) npos) const |
size_t | rfind (Char c, size_t pos=(size_t) npos) const |
size_t | find_last_of (const String &str, size_t pos=(size_t) npos) const |
size_t | find_last_of (Char c, size_t pos=(size_t) npos) const |
size_t | find_last_of (const Char *str, size_t pos=(size_t) npos) const |
size_t | find_last_not_of (const String &str, size_t pos=(size_t) npos) const |
size_t | find_last_not_of (const Char &c, size_t pos=(size_t) npos) const |
size_t | find_last_not_of (const Char *str, size_t pos=(size_t) npos) const |
String | substr (size_t pos=0, size_t n=(size_t) npos) const |
int | compare (const String &str) const |
int | compare (size_t pos, size_t n, const String &str) const |
int | compare (size_t pos1, size_t n1, const String &str, size_t pos2, size_t n2) const |
int | compare (const Char *s) const |
int | compare (const AChar *s) const |
int | compare (size_t pos, size_t n1, const Char *str, size_t n2=(size_t) npos) const |
int | icompare (const String &str) const |
int | icompare (size_t pos, size_t n, const String &str) const |
int | icompare (size_t pos1, size_t n1, const String &str, size_t pos2, size_t n2) const |
int | icompare (const Char *s) const |
int | icompare (const AChar *s) const |
int | icompare (size_t pos, size_t n1, const Char *str, size_t n2=(size_t) npos) const |
Int | to_int () const |
String & | make_upper () |
String & | make_lower () |
bool | match (const String &pattern, String &a0) const |
bool | match (const String &pattern, String &a0, String &a1) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2, String &a3) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2, String &a3, String &a4) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2, String &a3, String &a4, String &a5) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2, String &a3, String &a4, String &a5, String &a6) const |
bool | match (const String &pattern, String &a0, String &a1, String &a2, String &a3, String &a4, String &a5, String &a6, String &a7) const |
long | write_xml (OBStream &o) const |
long | write (CommBuffer &buffer) const |
long | read_xml (IBStream &i) |
long | read (const CommBuffer &buffer) |
String & | from_acsii (const AChar *s) |
Friends | |
class | Iterator |
Unicode string class. Is inspired by stl::string
commore::String::String | ( | const String & | str, |
size_t | pos, | ||
size_t | n = (size_t) npos |
||
) |
Constuctor with a substring
str | source string |
pos | start position |
n | size of substrins |
commore::String::String | ( | const Char * | str, |
size_t | n | ||
) |
Constuctor with a substring
str | source null terminated string |
n | size of substrins |
commore::String::String | ( | const Char * | str | ) |
Constuctor with a null terminated unicode string
str | source null terminated unicode string |
commore::String::String | ( | const AChar * | str, |
size_t | n | ||
) |
Constuctor with a unicode substring
str | source null terminated string |
n | size of substrins |
commore::String::String | ( | const AChar * | str | ) |
Constuctor with a null terminated string
str | source null terminated string |
commore::String::String | ( | size_t | n, |
Char | c | ||
) |
Fill Constructor Fills the string with n consecutive copies of unicode character c.
n | |
c |
Append unicode substring
str | source string |
pos | begin of substring |
n | size of substring |
|
inline |
Append unicode substring
str | source string |
n | size of substring |
|
inline |
Append null terminated substring
str | source string |
n | size of substring |
|
inline |
Append null terminated unicode substring
str | source string |
|
inline |
Append null terminated substring
str | source string |
|
inline |
Append n consecutive copies of character c.
n | |
c |
Assign string content with a substring
|
inline |
Assign string content with a null terminated substring
|
inline |
Assign string content with null terminated string
|
inline |
Assign string content with n consecutive copies of character c.
|
inline |
Assign string content with null terminated string
|
inline |
Assign string content with null terminated string
|
inline |
Assign string content with n consecutive copies of character c.
|
inline |
|
inline |
|
inline |
Get C unicode string equivalent
|
inline |
|
inline |
Clear string content
|
inline |
Copy sequence of characters from string Copies a substring of the current value of the string object into the array pointed by s. This substring contains the len characters that start at position pos. The function does not append a null character at the end of the copied content.
str | Pointer to an array of characters. The array shall contain enough storage for the copied characters. |
n | Number of characters to copy (if the string is shorter, as many characters as possible are copied). |
pos | Position of the first character to be copied. |
|
inline |
Convesion operator to null terminated string
|
inline |
|
inline |
Delete substring
pos | start position |
n | substring size |
|
inline |
Find content in string Searches the string for the first occurrence of the sequence specified by its arguments. When pos is specified, the search only includes characters at or after position pos, ignoring any possible occurrences that include characters before pos. Notice that unlike member find_first_of, whenever more than one character is being searched for, it is not enough that just one of these characters match, but the entire sequence must match.
str | Another string with the subject to search for. |
pos | Position of the first character in the string to be considered in the search. If this is greater than the string length, the function never finds matches. Note: The first character is denoted by a value of 0 (not 1): A value of 0 means that the entire string is searched. |
s | Pointer to an array of characters. If argument n is specified (3), the sequence to match are the first n characters in the array. Otherwise (2), a null-terminated sequence is expected: the length of the sequence to match is determined by the first occurrence of a null character. |
n | Length of sequence of characters to match. |
c | Individual character to be searched for. |
|
inline |
Reference to allocator
Insert string
pos1 | insert position |
str | string to insert |
Insert substring
pos1 | insert position |
str | string to insert |
pos2 | start substring position |
n | substring size |
|
inline |
Insert null terminated substring
pos | insert position |
str | null terminated string to insert |
n | substring size |
|
inline |
Insert null terminated substring
pos | insert position |
str | null terminated string to insert |
|
inline |
Insert n consecutive copies of character c.
pos | insert position |
n | |
c |
|
inline |
|
inline |
|
inline |
Implicit convesion operator to null terminated string
|
inline |
Tests the difference with a null terminated string
|
inline |
Tests difference with an unicode string
|
inline |
Tests the difference with a null terminated string
|
inline |
Append string operator
|
inline |
Append string operator
|
inline |
Append string operator
|
inline |
Append string operator
|
inline |
Compare string operator with lexical order
|
inline |
Assigment operator with null terminated unicode string
str | source null terminated string |
|
inline |
Assigment operator with null terminated string
str | source nult terminated string |
|
inline |
Assigment operator with an unicode caracter
c | source caracter |
|
inline |
Tests the equality with a null terminated string
|
inline |
Tests equality with an unicode string
|
inline |
Tests the equality with a null terminated unicode string
|
inline |
Compare string operator with lexical order
|
inline |
Get character of string
|
inline |
Get character of string
Replace a substring
pos | start position |
n | substring size |
str | replacement string |
|
inline |
Replace a substring
pos1 | start position |
n1 | substring size |
str | replacement string |
pos2 | substring start position |
n2 | substring size |
|
inline |
Replace a substring
pos1 | start position |
n1 | substring size |
str | replacement null terminated string |
n2 | substring size |
|
inline |
Replace a substring
pos1 | start position |
n1 | substring size |
str | replacement null terminated string |
|
inline |
Replace a substring by n2 consecutive copies of character c.
pos1 | start position |
n1 | substring size |
n2 | |
c |
|
inline |
Allocate a new string capacity
|
inline |
Resize string,fill with character c
|
inline |
Resize string
|
inline |
void commore::String::splice | ( | String & | str | ) |
Swap string content
void commore::String::swap | ( | String & | str | ) |
Swap string content
|
inline |
Check that interval is a substring
pos | interval start position |
len | interval length |