Laxkit  0.0.7.1
Public Member Functions | Protected Member Functions | Protected Attributes
Utf8String Class Reference

List of all members.

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 charc_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

chars
int bytes_allocated
int num_chars
int num_bytes

Constructor & Destructor Documentation

Utf8String::Utf8String ( const char str,
int  n = -1 
)

n is bytes.

References updateNumChars().


Member Function Documentation

unsigned int Utf8String::byte ( int  pos,
unsigned int  newbyte 
)

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.

void Utf8String::updateNumChars ( )
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().


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

Mon Feb 17 2014 11:52:58, Laxkit