Go to the documentation of this file.
33 #ifndef _UCOMMON_UNICODE_H_
34 #define _UCOMMON_UNICODE_H_
36 #ifndef _UCOMMON_STRING_H_
78 static const unsigned ucsize;
83 static const char *
nil;
90 static unsigned size(
const char *codepoint);
97 static size_t count(
const char *
string);
105 static char *offset(
char *
string, ssize_t position);
112 static ucs4_t codepoint(
const char *encoded);
119 static size_t chars(
const unicode_t string);
126 static size_t chars(
ucs4_t character);
134 static size_t unpack(
const unicode_t string,
char *text,
size_t size);
143 static size_t pack(
unicode_t unicode,
const char *cp,
size_t len);
148 static ucs4_t *udup(
const char *
string);
153 static ucs2_t *wdup(
const char *
string);
162 static const char *find(
const char *
string,
ucs4_t character,
size_t start = 0);
171 static const char *rfind(
const char *
string,
ucs4_t character,
size_t end = (
size_t)-1l);
179 static unsigned ccount(
const char *
string,
ucs4_t character);
186 static ucs4_t get(
const char *cp);
194 static void put(
ucs4_t character,
char *buf);
229 UString(
const char *text,
size_t size);
258 UString get(
size_t codepoint,
size_t size = 0)
const;
266 size_t get(
unicode_t unicode,
size_t size)
const;
285 ucs4_t at(
int position)
const;
294 return get(unicode, size);
303 UString operator()(
int codepoint,
size_t size)
const;
311 return operator()(0, size);
320 return operator()(-((
int)offset), 0);
330 return operator()((
int)offset, size);
338 void cut(
size_t offset,
size_t size = 0);
346 void paste(
size_t offset,
const char *text,
size_t size = 0);
355 const char *operator()(
int offset)
const;
379 unsigned ccount(
ucs4_t character)
const;
387 const char *find(
ucs4_t character,
size_t start = 0)
const;
395 const char *rfind(
ucs4_t character,
size_t end = npos)
const;
470 inline operator bool()
const {
487 ucs4_t operator[](
long codepoint)
const;
512 return (
const char *)text == string;
521 return (
const char *)text != string;
544 inline operator char*()
const {
552 inline size_t len(
void)
const {
557 inline ucs4_t *strudup(
const char *
string) {
561 inline ucs2_t *strwdup(
const char *
string) {
565 __EXPORT
unicode_t unidup(
const char *
string);
568 inline void dupfree<ucs2_t*>(
ucs2_t *string) {
573 inline void dupfree<ucs4_t*>(
ucs4_t *string) {
578 inline void dupfree<unicode_t>(
unicode_t string) {