Chromium Code Reviews| Index: runtime/vm/zone_text_buffer.h |
| diff --git a/runtime/vm/zone_text_buffer.h b/runtime/vm/zone_text_buffer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..28a39eb529f8aaddf0048696beefd5af584d827d |
| --- /dev/null |
| +++ b/runtime/vm/zone_text_buffer.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
|
zra
2017/02/09 20:37:48
2017
rmacnak
2017/02/11 01:44:12
Fixed in https://codereview.chromium.org/268681300
|
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#ifndef RUNTIME_VM_ZONE_TEXT_BUFFER_H_ |
| +#define RUNTIME_VM_ZONE_TEXT_BUFFER_H_ |
| + |
| +#include "vm/allocation.h" |
| +#include "vm/globals.h" |
| + |
| +namespace dart { |
| + |
| +class Zone; |
| + |
| +// TextBuffer maintains a dynamic character buffer with a printf-style way to |
| +// append text. |
| +class ZoneTextBuffer : ValueObject { |
| + public: |
| + ZoneTextBuffer(Zone* zone, intptr_t initial_capacity); |
| + ~ZoneTextBuffer() {} |
| + |
| + intptr_t Printf(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
| + void AddString(const char* s); |
| + |
| + char* buffer() { return buffer_; } |
| + intptr_t length() { return length_; } |
| + |
| + private: |
| + void EnsureCapacity(intptr_t len); |
| + Zone* zone_; |
| + char* buffer_; |
| + intptr_t length_; |
| + intptr_t capacity_; |
| +}; |
| + |
| +} // namespace dart |
| + |
| +#endif // RUNTIME_VM_ZONE_TEXT_BUFFER_H_ |