Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: runtime/platform/text_buffer.h

Issue 1497033003: - Remove the legacy debug protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef PLATFORM_TEXT_BUFFER_H_
6 #define PLATFORM_TEXT_BUFFER_H_
7
8 #include "vm/allocation.h"
9 #include "vm/globals.h"
10
11 namespace dart {
12
13
14 // TextBuffer maintains a dynamic character buffer with a printf-style way to
15 // append text.
16 class TextBuffer : ValueObject {
17 public:
18 explicit TextBuffer(intptr_t buf_size);
19 ~TextBuffer();
20
21 intptr_t Printf(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
22 void AddChar(char ch);
23 void EscapeAndAddCodeUnit(uint32_t cu);
24 void AddString(const char* s);
25 void AddEscapedString(const char* s);
26
27 void Clear();
28
29 char* buf() { return buf_; }
30 intptr_t length() { return msg_len_; }
31
32 // Steal ownership of the buffer pointer.
33 // NOTE: TextBuffer is empty afterwards.
34 const char* Steal();
35
36 private:
37 void EnsureCapacity(intptr_t len);
38 char* buf_;
39 intptr_t buf_size_;
40 intptr_t msg_len_;
41 };
42
43 } // namespace dart
44
45 #endif // PLATFORM_TEXT_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698