| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 VM_JSON_STREAM_H_ | 5 #ifndef VM_JSON_STREAM_H_ |
| 6 #define VM_JSON_STREAM_H_ | 6 #define VM_JSON_STREAM_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" // for Dart_Port | 8 #include "include/dart_api.h" // for Dart_Port |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 class DebuggerEvent; | 14 class DebuggerEvent; |
| 15 class Field; | 15 class Field; |
| 16 class Array; |
| 16 class GrowableObjectArray; | 17 class GrowableObjectArray; |
| 17 class Instance; | 18 class Instance; |
| 18 class JSONArray; | 19 class JSONArray; |
| 19 class JSONObject; | 20 class JSONObject; |
| 20 class Object; | 21 class Object; |
| 21 class SourceBreakpoint; | 22 class SourceBreakpoint; |
| 22 class Zone; | 23 class Zone; |
| 23 | 24 |
| 24 class JSONStream : ValueObject { | 25 class JSONStream : ValueObject { |
| 25 public: | 26 public: |
| 26 explicit JSONStream(intptr_t buf_size = 256); | 27 explicit JSONStream(intptr_t buf_size = 256); |
| 27 ~JSONStream(); | 28 ~JSONStream(); |
| 28 | 29 |
| 29 void Setup(Zone* zone, | 30 void Setup(Zone* zone, |
| 30 Dart_Port reply_port, | 31 Dart_Port reply_port, |
| 31 const GrowableObjectArray& path, | 32 const GrowableObjectArray& path, |
| 32 const GrowableObjectArray& option_keys, | 33 const Array& option_keys, |
| 33 const GrowableObjectArray& option_values); | 34 const Array& option_values); |
| 34 void PostReply(); | 35 void PostReply(); |
| 35 | 36 |
| 36 TextBuffer* buffer() { return &buffer_; } | 37 TextBuffer* buffer() { return &buffer_; } |
| 37 const char* ToCString() { return buffer_.buf(); } | 38 const char* ToCString() { return buffer_.buf(); } |
| 38 | 39 |
| 39 void set_reply_port(Dart_Port port); | 40 void set_reply_port(Dart_Port port); |
| 40 void SetArguments(const char** arguments, intptr_t num_arguments); | 41 void SetArguments(const char** arguments, intptr_t num_arguments); |
| 41 void SetOptions(const char** option_keys, const char** option_values, | 42 void SetOptions(const char** option_keys, const char** option_values, |
| 42 intptr_t num_options); | 43 intptr_t num_options); |
| 43 | 44 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 214 |
| 214 friend class JSONObject; | 215 friend class JSONObject; |
| 215 | 216 |
| 216 DISALLOW_ALLOCATION(); | 217 DISALLOW_ALLOCATION(); |
| 217 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 218 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 } // namespace dart | 221 } // namespace dart |
| 221 | 222 |
| 222 #endif // VM_JSON_STREAM_H_ | 223 #endif // VM_JSON_STREAM_H_ |
| OLD | NEW |