| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PLATFORM_TEXT_BUFFER_H_ | 5 #ifndef PLATFORM_TEXT_BUFFER_H_ |
| 6 #define PLATFORM_TEXT_BUFFER_H_ | 6 #define PLATFORM_TEXT_BUFFER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 void AddRaw(const uint8_t* buffer, | 27 void AddRaw(const uint8_t* buffer, |
| 28 intptr_t buffer_length); | 28 intptr_t buffer_length); |
| 29 | 29 |
| 30 void Clear(); | 30 void Clear(); |
| 31 | 31 |
| 32 char* buf() { return buf_; } | 32 char* buf() { return buf_; } |
| 33 intptr_t length() { return msg_len_; } | 33 intptr_t length() { return msg_len_; } |
| 34 | 34 |
| 35 // Steal ownership of the buffer pointer. | 35 // Steal ownership of the buffer pointer. |
| 36 // NOTE: TextBuffer is empty afterwards. | 36 // NOTE: TextBuffer is empty afterwards. |
| 37 const char* Steal(); | 37 char* Steal(); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 void EnsureCapacity(intptr_t len); | 40 void EnsureCapacity(intptr_t len); |
| 41 char* buf_; | 41 char* buf_; |
| 42 intptr_t buf_size_; | 42 intptr_t buf_size_; |
| 43 intptr_t msg_len_; | 43 intptr_t msg_len_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace dart | 46 } // namespace dart |
| 47 | 47 |
| 48 #endif // PLATFORM_TEXT_BUFFER_H_ | 48 #endif // PLATFORM_TEXT_BUFFER_H_ |
| OLD | NEW |