#include <text_buffer.h>
Definition at line 15 of file text_buffer.h.
◆ BaseTextBuffer() [1/2]
dart::BaseTextBuffer::BaseTextBuffer |
( |
| ) |
|
|
inline |
◆ BaseTextBuffer() [2/2]
dart::BaseTextBuffer::BaseTextBuffer |
( |
char * |
buffer, |
|
|
intptr_t |
capacity |
|
) |
| |
|
inline |
◆ ~BaseTextBuffer()
virtual dart::BaseTextBuffer::~BaseTextBuffer |
( |
| ) |
|
|
inlinevirtual |
◆ AddChar()
void dart::BaseTextBuffer::AddChar |
( |
char |
ch | ) |
|
Definition at line 49 of file text_buffer.cc.
49 {
54}
virtual bool EnsureCapacity(intptr_t len)=0
◆ AddEscapedLatin1()
void dart::BaseTextBuffer::AddEscapedLatin1 |
( |
const uint8_t * |
code_units, |
|
|
intptr_t |
len |
|
) |
| |
Definition at line 94 of file text_buffer.cc.
94 {
95 const uint8_t* cursor =
s;
96 const uint8_t*
end = cursor +
len;
97
98 intptr_t needed = 0;
99 while (cursor < end) {
100 needed += EscapedCodeUnitLength(*cursor++);
101 }
102
104
106 while (cursor < end) {
107 EscapeAndAddCodeUnit(*cursor++);
108 }
110}
◆ AddEscapedString()
void dart::BaseTextBuffer::AddEscapedString |
( |
const char * |
s | ) |
|
Definition at line 267 of file text_buffer.cc.
267 {
269}
void AddEscapedUTF8(const char *s, intptr_t len)
◆ AddEscapedUTF16()
void dart::BaseTextBuffer::AddEscapedUTF16 |
( |
const uint16_t * |
code_units, |
|
|
intptr_t |
len |
|
) |
| |
Definition at line 112 of file text_buffer.cc.
112 {
113 for (
const uint16_t* end =
s +
len;
s <
end;
s++) {
115
116 uint16_t code_unit = *
s;
118 EscapeAndAddUTF16CodeUnit(code_unit);
121 EscapeAndAddUTF16CodeUnit(code_unit);
122 } else {
123 uint16_t next_code_unit = *(
s + 1);
126 EscapeAndAddCodeUnit(decoded);
128 } else {
129 EscapeAndAddUTF16CodeUnit(code_unit);
130 }
131 }
132 } else {
133 EscapeAndAddCodeUnit(code_unit);
134 }
135 }
137}
static int32_t Decode(uint16_t lead, uint16_t trail)
static bool IsLeadSurrogate(uint32_t ch)
static bool IsTrailSurrogate(uint32_t ch)
◆ AddEscapedUTF8()
void dart::BaseTextBuffer::AddEscapedUTF8 |
( |
const char * |
s, |
|
|
intptr_t |
len |
|
) |
| |
Definition at line 66 of file text_buffer.cc.
66 {
67 const uint8_t* cursor =
reinterpret_cast<const uint8_t*
>(
s);
68 const uint8_t*
end = cursor +
len;
69
70 intptr_t needed = 0;
71 while (cursor < end) {
72 uint8_t codeunit = *cursor++;
73 if (codeunit >= 0x80) {
74 needed += 1;
75 } else {
76 needed += EscapedCodeUnitLength(codeunit);
77 }
78 }
79
81
82 cursor =
reinterpret_cast<const uint8_t*
>(
s);
83 while (cursor < end) {
84 uint8_t codeunit = *cursor++;
85 if (codeunit >= 0x80) {
87 } else {
88 EscapeAndAddCodeUnit(codeunit);
89 }
90 }
92}
◆ AddRaw()
void dart::BaseTextBuffer::AddRaw |
( |
const uint8_t * |
buffer, |
|
|
intptr_t |
buffer_length |
|
) |
| |
◆ AddString()
void dart::BaseTextBuffer::AddString |
( |
const char * |
s | ) |
|
Definition at line 263 of file text_buffer.cc.
263 {
264 AddRaw(
reinterpret_cast<const uint8_t*
>(
s), strlen(
s));
265}
void AddRaw(const uint8_t *buffer, intptr_t buffer_length)
◆ buffer()
char * dart::BaseTextBuffer::buffer |
( |
| ) |
const |
|
inline |
◆ Clear()
virtual void dart::BaseTextBuffer::Clear |
( |
| ) |
|
|
pure virtual |
◆ DISALLOW_COPY_AND_ASSIGN()
◆ EnsureCapacity()
virtual bool dart::BaseTextBuffer::EnsureCapacity |
( |
intptr_t |
len | ) |
|
|
protectedpure virtual |
◆ length()
intptr_t dart::BaseTextBuffer::length |
( |
| ) |
const |
|
inline |
◆ Printf()
intptr_t dart::BaseTextBuffer::Printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Definition at line 14 of file text_buffer.cc.
14 {
20}
intptr_t intptr_t VPrintf(const char *format, va_list args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
◆ VPrintf()
intptr_t dart::BaseTextBuffer::VPrintf |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
Definition at line 22 of file text_buffer.cc.
22 {
23 va_list args1;
29 if (
len >= remaining) {
33 return remaining - 1;
34 }
37 va_list args2;
39 intptr_t len2 =
43 }
47}
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
◆ buffer_
char* dart::BaseTextBuffer::buffer_ |
|
protected |
◆ capacity_
intptr_t dart::BaseTextBuffer::capacity_ |
|
protected |
◆ length_
intptr_t dart::BaseTextBuffer::length_ |
|
protected |
The documentation for this class was generated from the following files: