| 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" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void PrintValueNoEscape(const char* s); | 115 void PrintValueNoEscape(const char* s); |
| 116 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 116 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
| 117 void PrintValue(const Object& o, bool ref = true); | 117 void PrintValue(const Object& o, bool ref = true); |
| 118 void PrintValue(SourceBreakpoint* bpt); | 118 void PrintValue(SourceBreakpoint* bpt); |
| 119 void PrintValue(const ServiceEvent* event); | 119 void PrintValue(const ServiceEvent* event); |
| 120 void PrintValue(Metric* metric); | 120 void PrintValue(Metric* metric); |
| 121 void PrintValue(MessageQueue* queue); | 121 void PrintValue(MessageQueue* queue); |
| 122 void PrintValue(Isolate* isolate, bool ref = true); | 122 void PrintValue(Isolate* isolate, bool ref = true); |
| 123 bool PrintValueStr(const String& s, intptr_t limit); | 123 bool PrintValueStr(const String& s, intptr_t limit); |
| 124 | 124 |
| 125 void PrintServiceId(const char* name, const Object& o); | 125 void PrintServiceId(const Object& o); |
| 126 void PrintPropertyBool(const char* name, bool b); | 126 void PrintPropertyBool(const char* name, bool b); |
| 127 void PrintProperty(const char* name, intptr_t i); | 127 void PrintProperty(const char* name, intptr_t i); |
| 128 void PrintProperty64(const char* name, int64_t i); | 128 void PrintProperty64(const char* name, int64_t i); |
| 129 void PrintProperty(const char* name, double d); | 129 void PrintProperty(const char* name, double d); |
| 130 void PrintProperty(const char* name, const char* s); | 130 void PrintProperty(const char* name, const char* s); |
| 131 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); | 131 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); |
| 132 void PrintPropertyNoEscape(const char* name, const char* s); | 132 void PrintPropertyNoEscape(const char* name, const char* s); |
| 133 void PrintfProperty(const char* name, const char* format, ...) | 133 void PrintfProperty(const char* name, const char* format, ...) |
| 134 PRINTF_ATTRIBUTE(3, 4); | 134 PRINTF_ATTRIBUTE(3, 4); |
| 135 void PrintProperty(const char* name, const Object& o, bool ref = true); | 135 void PrintProperty(const char* name, const Object& o, bool ref = true); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 JSONObject(const JSONObject* obj, const char* name) : stream_(obj->stream_) { | 175 JSONObject(const JSONObject* obj, const char* name) : stream_(obj->stream_) { |
| 176 stream_->OpenObject(name); | 176 stream_->OpenObject(name); |
| 177 } | 177 } |
| 178 explicit JSONObject(const JSONArray* arr); | 178 explicit JSONObject(const JSONArray* arr); |
| 179 | 179 |
| 180 ~JSONObject() { | 180 ~JSONObject() { |
| 181 stream_->CloseObject(); | 181 stream_->CloseObject(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void AddServiceId(const char* name, const Object& o) const { | 184 void AddServiceId(const Object& o) const { |
| 185 stream_->PrintServiceId(name, o); | 185 stream_->PrintServiceId(o); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void AddFixedServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3); |
| 189 |
| 188 void AddProperty(const char* name, bool b) const { | 190 void AddProperty(const char* name, bool b) const { |
| 189 stream_->PrintPropertyBool(name, b); | 191 stream_->PrintPropertyBool(name, b); |
| 190 } | 192 } |
| 191 void AddProperty(const char* name, intptr_t i) const { | 193 void AddProperty(const char* name, intptr_t i) const { |
| 192 stream_->PrintProperty(name, i); | 194 stream_->PrintProperty(name, i); |
| 193 } | 195 } |
| 194 void AddProperty64(const char* name, int64_t i) const { | 196 void AddProperty64(const char* name, int64_t i) const { |
| 195 stream_->PrintProperty64(name, i); | 197 stream_->PrintProperty64(name, i); |
| 196 } | 198 } |
| 197 void AddProperty(const char* name, double d) const { | 199 void AddProperty(const char* name, double d) const { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 286 |
| 285 friend class JSONObject; | 287 friend class JSONObject; |
| 286 | 288 |
| 287 DISALLOW_ALLOCATION(); | 289 DISALLOW_ALLOCATION(); |
| 288 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 290 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
| 289 }; | 291 }; |
| 290 | 292 |
| 291 } // namespace dart | 293 } // namespace dart |
| 292 | 294 |
| 293 #endif // VM_JSON_STREAM_H_ | 295 #endif // VM_JSON_STREAM_H_ |
| OLD | NEW |