#include <stddef.h>
#include <iterator>
#include <string>
#include <utility>
#include "syntaxnet/base.h"
Go to the source code of this file.
|
bool | operator== (const UnicodeText &lhs, const UnicodeText &rhs) |
|
bool | operator!= (const UnicodeText &lhs, const UnicodeText &rhs) |
|
bool | UnicodeTextRangeIsEmpty (const UnicodeTextRange &r) |
|
UnicodeText | MakeUnicodeTextAcceptingOwnership (char *utf8_buffer, int byte_length, int byte_capacity) |
|
UnicodeText | MakeUnicodeTextWithoutAcceptingOwnership (const char *utf8_buffer, int byte_length) |
|
UnicodeText | UTF8ToUnicodeText (const char *utf8_buf, int len, bool do_copy) |
|
UnicodeText | UTF8ToUnicodeText (const string &utf_string, bool do_copy) |
|
UnicodeText | UTF8ToUnicodeText (const char *utf8_buf, int len) |
|
UnicodeText | UTF8ToUnicodeText (const string &utf8_string) |
|
string | UnicodeTextToUTF8 (const UnicodeText &t) |
|
template<typename T , size_t N> |
char(& | ArraySizeHelper (T(&array)[N]))[N] |
|
string | CodepointString (const UnicodeText &t) |
|
◆ arraysize
◆ UnicodeTextRange
◆ ArraySizeHelper()
template<typename T , size_t N>
char(& ArraySizeHelper |
( |
T(&) |
array[N] | ) |
)[N] |
◆ CodepointString()
◆ MakeUnicodeTextAcceptingOwnership()
UnicodeText MakeUnicodeTextAcceptingOwnership |
( |
char * |
utf8_buffer, |
|
|
int |
byte_length, |
|
|
int |
byte_capacity |
|
) |
| |
|
inline |
Definition at line 420 of file unicodetext.h.
421 {
423}
UnicodeText & TakeOwnershipOfUTF8(char *utf8_buffer, int byte_length, int byte_capacity)
◆ MakeUnicodeTextWithoutAcceptingOwnership()
UnicodeText MakeUnicodeTextWithoutAcceptingOwnership |
( |
const char * |
utf8_buffer, |
|
|
int |
byte_length |
|
) |
| |
|
inline |
Definition at line 429 of file unicodetext.h.
430 {
432}
UnicodeText & PointToUTF8(const char *utf8_buffer, int byte_length)
◆ operator!=()
Definition at line 397 of file unicodetext.h.
397 {
398 return !(lhs == rhs);
399}
◆ operator==()
Definition at line 178 of file unicodetext.cc.
377 {
378 if (&lhs == &rhs)
379 return true;
380 if (lhs.repr_.size_ != rhs.repr_.size_)
381 return false;
382 return memcmp(lhs.repr_.data_, rhs.repr_.data_, lhs.repr_.size_) == 0;
383}
◆ UnicodeTextRangeIsEmpty()
Definition at line 405 of file unicodetext.h.
405 {
406 return r.first == r.second;
407}
◆ UnicodeTextToUTF8()
Definition at line 474 of file unicodetext.h.
474 {
476}
const char * utf8_data() const
◆ UTF8ToUnicodeText() [1/4]
UnicodeText UTF8ToUnicodeText |
( |
const char * |
utf8_buf, |
|
|
int |
len |
|
) |
| |
|
inline |
Definition at line 465 of file unicodetext.h.
465 {
467}
UnicodeText UTF8ToUnicodeText(const char *utf8_buf, int len, bool do_copy)
◆ UTF8ToUnicodeText() [2/4]
UnicodeText UTF8ToUnicodeText |
( |
const char * |
utf8_buf, |
|
|
int |
len, |
|
|
bool |
do_copy |
|
) |
| |
|
inline |
Definition at line 451 of file unicodetext.h.
451 {
453 if (do_copy) {
455 } else {
457 }
458 return t;
459}
UnicodeText & CopyUTF8(const char *utf8_buffer, int byte_length)
◆ UTF8ToUnicodeText() [3/4]
UnicodeText UTF8ToUnicodeText |
( |
const string & |
utf8_string | ) |
|
|
inline |
◆ UTF8ToUnicodeText() [4/4]
UnicodeText UTF8ToUnicodeText |
( |
const string & |
utf_string, |
|
|
bool |
do_copy |
|
) |
| |
|
inline |