29 if (
len >= remaining) {
67 const uint8_t* cursor =
reinterpret_cast<const uint8_t*
>(
s);
68 const uint8_t*
end = cursor +
len;
71 while (cursor <
end) {
72 uint8_t codeunit = *cursor++;
73 if (codeunit >= 0x80) {
76 needed += EscapedCodeUnitLength(codeunit);
82 cursor =
reinterpret_cast<const uint8_t*
>(
s);
83 while (cursor <
end) {
84 uint8_t codeunit = *cursor++;
85 if (codeunit >= 0x80) {
88 EscapeAndAddCodeUnit(codeunit);
95 const uint8_t* cursor =
s;
96 const uint8_t*
end = cursor +
len;
99 while (cursor <
end) {
100 needed += EscapedCodeUnitLength(*cursor++);
106 while (cursor <
end) {
107 EscapeAndAddCodeUnit(*cursor++);
116 uint16_t code_unit = *
s;
118 EscapeAndAddUTF16CodeUnit(code_unit);
121 EscapeAndAddUTF16CodeUnit(code_unit);
123 uint16_t next_code_unit = *(
s + 1);
126 EscapeAndAddCodeUnit(decoded);
129 EscapeAndAddUTF16CodeUnit(code_unit);
133 EscapeAndAddCodeUnit(code_unit);
140intptr_t BaseTextBuffer::EscapedCodeUnitLength(uint32_t codeunit) {
152 if (codeunit < 0x20) {
174void BaseTextBuffer::EscapeAndAddCodeUnit(uint32_t codeunit) {
218 constexpr int kMask = ~(1 << 6);
219 if (codeunit < 0x20) {
252void BaseTextBuffer::EscapeAndAddUTF16CodeUnit(uint16_t codeunit) {
264 AddRaw(
reinterpret_cast<const uint8_t*
>(
s), strlen(
s));
291bool TextBuffer::EnsureCapacity(intptr_t
len) {
293 if (remaining <=
len) {
296 char* new_buf =
reinterpret_cast<char*
>(
realloc(
buffer_, new_size));
void AddString(const char *s)
intptr_t Printf(const char *format,...) PRINTF_ATTRIBUTE(2
void AddEscapedLatin1(const uint8_t *code_units, intptr_t len)
intptr_t intptr_t VPrintf(const char *format, va_list args)
void AddEscapedString(const char *s)
void AddRaw(const uint8_t *buffer, intptr_t buffer_length)
void AddEscapedUTF8(const char *s, intptr_t len)
void AddEscapedUTF16(const uint16_t *code_units, intptr_t len)
virtual bool EnsureCapacity(intptr_t len)=0
TextBuffer(intptr_t buf_size)
static int32_t Decode(uint16_t lead, uint16_t trail)
static bool IsLeadSurrogate(uint32_t ch)
static bool IsTrailSurrogate(uint32_t ch)
static constexpr int32_t kMaxTwoByteChar
static constexpr int32_t kMaxFourByteChar
static constexpr int32_t kMaxThreeByteChar
static constexpr int32_t kMaxOneByteChar
static constexpr T Maximum(T x, T y)
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
void * malloc(size_t size)
static uint8_t Hex(uint8_t value)
void * realloc(void *ptr, size_t size)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer