Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ZoneTextBuffer Class Reference

#include <zone_text_buffer.h>

Inheritance diagram for dart::ZoneTextBuffer:
dart::BaseTextBuffer dart::ValueObject

Public Member Functions

 ZoneTextBuffer (Zone *zone, intptr_t initial_capacity=64)
 
 ~ZoneTextBuffer ()
 
void Clear ()
 
- Public Member Functions inherited from dart::BaseTextBuffer
 BaseTextBuffer ()
 
 BaseTextBuffer (char *buffer, intptr_t capacity)
 
virtual ~BaseTextBuffer ()
 
intptr_t Printf (const char *format,...) PRINTF_ATTRIBUTE(2
 
intptr_t intptr_t VPrintf (const char *format, va_list args)
 
void AddChar (char ch)
 
void AddString (const char *s)
 
void AddRaw (const uint8_t *buffer, intptr_t buffer_length)
 
void AddEscapedString (const char *s)
 
void AddEscapedUTF8 (const char *s, intptr_t len)
 
void AddEscapedLatin1 (const uint8_t *code_units, intptr_t len)
 
void AddEscapedUTF16 (const uint16_t *code_units, intptr_t len)
 
char * buffer () const
 
intptr_t length () const
 
virtual void Clear ()=0
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Additional Inherited Members

- Protected Member Functions inherited from dart::BaseTextBuffer
virtual bool EnsureCapacity (intptr_t len)=0
 
 DISALLOW_COPY_AND_ASSIGN (BaseTextBuffer)
 
- Protected Attributes inherited from dart::BaseTextBuffer
char * buffer_
 
intptr_t capacity_
 
intptr_t length_
 

Detailed Description

Definition at line 19 of file zone_text_buffer.h.

Constructor & Destructor Documentation

◆ ZoneTextBuffer()

dart::ZoneTextBuffer::ZoneTextBuffer ( Zone zone,
intptr_t  initial_capacity = 64 
)
explicit

Definition at line 16 of file zone_text_buffer.cc.

17 : zone_(zone) {
18 ASSERT(initial_capacity > 0);
19 buffer_ = reinterpret_cast<char*>(zone->Alloc<char>(initial_capacity));
20 capacity_ = initial_capacity;
21 buffer_[length_] = '\0';
22}
#define ASSERT(E)

◆ ~ZoneTextBuffer()

dart::ZoneTextBuffer::~ZoneTextBuffer ( )
inline

Definition at line 22 of file zone_text_buffer.h.

22{}

Member Function Documentation

◆ Clear()

void dart::ZoneTextBuffer::Clear ( )
virtual

Implements dart::BaseTextBuffer.

Definition at line 24 of file zone_text_buffer.cc.

24 {
25 const intptr_t initial_capacity = 64;
26 buffer_ = reinterpret_cast<char*>(zone_->Alloc<char>(initial_capacity));
27 capacity_ = initial_capacity;
28 length_ = 0;
29 buffer_[length_] = '\0';
30}
ElementType * Alloc(intptr_t length)

The documentation for this class was generated from the following files: