Lines Matching refs:buffer
59 // This routine is called only when we've discovered that a UTF-8 buffer
71 // reads, it is safe to change the buffer in place. It returns the
113 // Otherwise, allocate a new buffer.
117 // If there is an old buffer, copy it into the new buffer.
120 if (ours_) delete[] data_; // If we owned the old buffer, free it.
123 ours_ = true; // We own the new buffer.
139 // This implementation of clear() deallocates the buffer if we're an owner.
155 if (ours_ && data_) delete[] data_; // If we owned the old buffer, free it.
163 if (ours_ && data_) delete[] data_; // If we owned the old buffer, free it.
232 UnicodeText& UnicodeText::CopyUTF8(const char* buffer, int byte_length) {
233 repr_.Copy(buffer, byte_length);
234 repr_.utf8_was_valid_ = UniLib:: IsInterchangeValid(buffer, byte_length);
236 LOG(WARNING) << "UTF-8 buffer is not interchange-valid.";
242 UnicodeText& UnicodeText::UnsafeCopyUTF8(const char* buffer,
244 repr_.Copy(buffer, byte_length);
250 UnicodeText& UnicodeText::TakeOwnershipOfUTF8(char* buffer,
253 repr_.TakeOwnershipOf(buffer, byte_length, byte_capacity);
254 repr_.utf8_was_valid_ = UniLib:: IsInterchangeValid(buffer, byte_length);
256 LOG(WARNING) << "UTF-8 buffer is not interchange-valid.";
262 UnicodeText& UnicodeText::UnsafeTakeOwnershipOfUTF8(char* buffer,
265 repr_.TakeOwnershipOf(buffer, byte_length, byte_capacity);
271 UnicodeText& UnicodeText::PointToUTF8(const char* buffer, int byte_length) {
272 repr_.utf8_was_valid_ = UniLib:: IsInterchangeValid(buffer, byte_length);
274 repr_.PointTo(buffer, byte_length);
276 LOG(WARNING) << "UTF-8 buffer is not interchange-valid.";
277 repr_.Copy(buffer, byte_length);
283 UnicodeText& UnicodeText::UnsafePointToUTF8(const char* buffer,
285 repr_.PointTo(buffer, byte_length);