Lines Matching defs:UnicodeText
17 #include "utils/utf8/unicodetext.h"
31 UnicodeText::Repr& UnicodeText::Repr::operator=(Repr&& src) {
41 void UnicodeText::Repr::PointTo(const char* data, int size) {
49 void UnicodeText::Repr::Copy(const char* data, int size) {
54 void UnicodeText::Repr::resize(int new_size) {
66 void UnicodeText::Repr::reserve(int new_capacity) {
84 void UnicodeText::Repr::append(const char* bytes, int byte_length) {
90 void UnicodeText::Repr::clear() {
97 // *************** UnicodeText ******************
99 UnicodeText::UnicodeText() {}
101 UnicodeText::UnicodeText(const UnicodeText& src) { Copy(src); }
103 UnicodeText& UnicodeText::operator=(UnicodeText&& src) {
108 UnicodeText& UnicodeText::Copy(const UnicodeText& src) {
113 UnicodeText& UnicodeText::PointToUTF8(const char* buffer, int byte_length) {
118 UnicodeText& UnicodeText::CopyUTF8(const char* buffer, int byte_length) {
123 UnicodeText& UnicodeText::AppendUTF8(const char* utf8, int len) {
128 const char* UnicodeText::data() const { return repr_.data_; }
130 int UnicodeText::size_bytes() const { return repr_.size_; }
180 UnicodeText& UnicodeText::push_back(char32 ch) {
187 void UnicodeText::clear() { repr_.clear(); }
189 int UnicodeText::size_codepoints() const {
193 bool UnicodeText::empty() const { return size_bytes() == 0; }
195 bool UnicodeText::is_valid() const {
199 bool UnicodeText::operator==(const UnicodeText& other) const {
206 std::string UnicodeText::ToUTF8String() const {
210 std::string UnicodeText::UTF8Substring(int begin_codepoint,
219 std::string UnicodeText::UTF8Substring(const const_iterator& it_begin,
224 UnicodeText UnicodeText::Substring(const UnicodeText& text, int begin_codepoint,
232 UnicodeText result;
236 UnicodeText result;
242 UnicodeText::~UnicodeText() {}
244 // ******************* UnicodeText::const_iterator *********************
250 UnicodeText::const_iterator::const_iterator() : it_(0) {}
252 UnicodeText::const_iterator& UnicodeText::const_iterator::operator=(
258 UnicodeText::const_iterator UnicodeText::begin() const {
262 UnicodeText::const_iterator UnicodeText::end() const {
266 bool operator<(const UnicodeText::const_iterator& lhs,
267 const UnicodeText::const_iterator& rhs) {
271 char32 UnicodeText::const_iterator::operator*() const {
294 UnicodeText::const_iterator& UnicodeText::const_iterator::operator++() {
299 UnicodeText::const_iterator& UnicodeText::const_iterator::operator--() {
305 UnicodeText UTF8ToUnicodeText(const char* utf8_buf, int len, bool do_copy) {
306 UnicodeText t;
315 UnicodeText UTF8ToUnicodeText(const char* utf8_buf, bool do_copy) {
319 UnicodeText UTF8ToUnicodeText(const std::string& str, bool do_copy) {
323 UnicodeText UTF8ToUnicodeText(const std::string& str) {