Laxkit
0.0.7.1
|
Public Member Functions | |
Utf8String (const char *str, int n=-1) | |
Utf8String (const Utf8String &str) | |
Utf8String (const Utf8String str) | |
Utf8String (int i) | |
Utf8String (double i) | |
Utf8String (const char *fmt,...) | |
int | chars () |
int | bytes () |
int | capacity () |
void | clear () |
operator= (const char *str) | |
operator= (const Utf8String &str) | |
operator+= () | |
operator== () | |
operator!= () | |
operator<= () | |
operator< () | |
operator>= () | |
operator> () | |
operator+ () | |
int | strcmp (const Utf8String &str) |
int | strcasecmp (const Utf8String &str) |
const char * | c_str () |
unsigned int | ch (int pos) |
unsigned int | ch (int pos, unsigned int newch) |
unsigned int | byte (int pos) |
unsigned int | byte (int pos, unsigned int newbyte) |
unsigned int | next (int curpos) |
unsigned int | prev (int curpos) |
void | append (const Utf8String &str) |
void | append (const char *str) |
int | find (const char *str, int startat) |
int | rfind (const char *str, int startat) |
int | find (unsigned int ch, int startat) |
int | rfind (unsigned int ch, int startat) |
int | replace (const char *newstr, const char *oldstr, bool all) |
Utf8String | substr (unsigned int from, unsigned int to) |
Protected Member Functions | |
void | updateNumChars () |
Protected Attributes | |
char * | s |
int | bytes_allocated |
int | num_chars |
int | num_bytes |
n is bytes.
References updateNumChars().
Set a byte. Does NOT do bounds checking.
Utf8String Utf8String::substr | ( | unsigned int | from, |
unsigned int | to | ||
) |
Return new Utf8String from substring [from..to]. from and to are char positions, not bytes.
|
protected |
Make num_chars be the number of unicode characters in the string (not graphemes, but merely unicode chars).
References Laxkit::utf8fwd().
Referenced by Utf8String().