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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void OpenObject(const char* property_name = NULL); | 116 void OpenObject(const char* property_name = NULL); |
117 void CloseObject(); | 117 void CloseObject(); |
118 | 118 |
119 void OpenArray(const char* property_name = NULL); | 119 void OpenArray(const char* property_name = NULL); |
120 void CloseArray(); | 120 void CloseArray(); |
121 | 121 |
122 void PrintValueBool(bool b); | 122 void PrintValueBool(bool b); |
123 void PrintValue(intptr_t i); | 123 void PrintValue(intptr_t i); |
124 void PrintValue64(int64_t i); | 124 void PrintValue64(int64_t i); |
125 void PrintValueTimeMillis(int64_t millis); | 125 void PrintValueTimeMillis(int64_t millis); |
| 126 void PrintValueTimeMicros(int64_t micros); |
126 void PrintValue(double d); | 127 void PrintValue(double d); |
127 void PrintValueBase64(const uint8_t* bytes, intptr_t length); | 128 void PrintValueBase64(const uint8_t* bytes, intptr_t length); |
128 void PrintValue(const char* s); | 129 void PrintValue(const char* s); |
129 void PrintValue(const char* s, intptr_t len); | 130 void PrintValue(const char* s, intptr_t len); |
130 void PrintValueNoEscape(const char* s); | 131 void PrintValueNoEscape(const char* s); |
131 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 132 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
132 void PrintValue(const Object& o, bool ref = true); | 133 void PrintValue(const Object& o, bool ref = true); |
133 void PrintValue(Breakpoint* bpt); | 134 void PrintValue(Breakpoint* bpt); |
134 void PrintValue(const ServiceEvent* event); | 135 void PrintValue(const ServiceEvent* event); |
135 void PrintValue(Metric* metric); | 136 void PrintValue(Metric* metric); |
136 void PrintValue(MessageQueue* queue); | 137 void PrintValue(MessageQueue* queue); |
137 void PrintValue(Isolate* isolate, bool ref = true); | 138 void PrintValue(Isolate* isolate, bool ref = true); |
138 bool PrintValueStr(const String& s, intptr_t limit); | 139 bool PrintValueStr(const String& s, intptr_t limit); |
139 void PrintValue(TimelineEvent* timeline_event); | 140 void PrintValue(TimelineEvent* timeline_event); |
140 | 141 |
141 void PrintServiceId(const Object& o); | 142 void PrintServiceId(const Object& o); |
142 void PrintPropertyBool(const char* name, bool b); | 143 void PrintPropertyBool(const char* name, bool b); |
143 void PrintProperty(const char* name, intptr_t i); | 144 void PrintProperty(const char* name, intptr_t i); |
144 void PrintProperty64(const char* name, int64_t i); | 145 void PrintProperty64(const char* name, int64_t i); |
145 void PrintPropertyTimeMillis(const char* name, int64_t millis); | 146 void PrintPropertyTimeMillis(const char* name, int64_t millis); |
| 147 void PrintPropertyTimeMicros(const char* name, int64_t micros); |
146 void PrintProperty(const char* name, double d); | 148 void PrintProperty(const char* name, double d); |
147 void PrintPropertyBase64(const char* name, | 149 void PrintPropertyBase64(const char* name, |
148 const uint8_t* bytes, | 150 const uint8_t* bytes, |
149 intptr_t length); | 151 intptr_t length); |
150 void PrintProperty(const char* name, const char* s); | 152 void PrintProperty(const char* name, const char* s); |
151 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); | 153 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); |
152 void PrintPropertyNoEscape(const char* name, const char* s); | 154 void PrintPropertyNoEscape(const char* name, const char* s); |
153 void PrintfProperty(const char* name, const char* format, ...) | 155 void PrintfProperty(const char* name, const char* format, ...) |
154 PRINTF_ATTRIBUTE(3, 4); | 156 PRINTF_ATTRIBUTE(3, 4); |
155 void PrintProperty(const char* name, const Object& o, bool ref = true); | 157 void PrintProperty(const char* name, const Object& o, bool ref = true); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 223 } |
222 void AddProperty(const char* name, intptr_t i) const { | 224 void AddProperty(const char* name, intptr_t i) const { |
223 stream_->PrintProperty(name, i); | 225 stream_->PrintProperty(name, i); |
224 } | 226 } |
225 void AddProperty64(const char* name, int64_t i) const { | 227 void AddProperty64(const char* name, int64_t i) const { |
226 stream_->PrintProperty64(name, i); | 228 stream_->PrintProperty64(name, i); |
227 } | 229 } |
228 void AddPropertyTimeMillis(const char* name, int64_t millis) const { | 230 void AddPropertyTimeMillis(const char* name, int64_t millis) const { |
229 stream_->PrintPropertyTimeMillis(name, millis); | 231 stream_->PrintPropertyTimeMillis(name, millis); |
230 } | 232 } |
| 233 void AddPropertyTimeMicros(const char* name, int64_t micros) const { |
| 234 stream_->PrintPropertyTimeMicros(name, micros); |
| 235 } |
231 void AddProperty(const char* name, double d) const { | 236 void AddProperty(const char* name, double d) const { |
232 stream_->PrintProperty(name, d); | 237 stream_->PrintProperty(name, d); |
233 } | 238 } |
234 void AddPropertyBase64(const char* name, | 239 void AddPropertyBase64(const char* name, |
235 const uint8_t* bytes, | 240 const uint8_t* bytes, |
236 intptr_t length) const { | 241 intptr_t length) const { |
237 stream_->PrintPropertyBase64(name, bytes, length); | 242 stream_->PrintPropertyBase64(name, bytes, length); |
238 } | 243 } |
239 void AddProperty(const char* name, const char* s) const { | 244 void AddProperty(const char* name, const char* s) const { |
240 stream_->PrintProperty(name, s); | 245 stream_->PrintProperty(name, s); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 ~JSONArray() { | 300 ~JSONArray() { |
296 stream_->CloseArray(); | 301 stream_->CloseArray(); |
297 } | 302 } |
298 | 303 |
299 void AddValue(bool b) const { stream_->PrintValueBool(b); } | 304 void AddValue(bool b) const { stream_->PrintValueBool(b); } |
300 void AddValue(intptr_t i) const { stream_->PrintValue(i); } | 305 void AddValue(intptr_t i) const { stream_->PrintValue(i); } |
301 void AddValue64(int64_t i) const { stream_->PrintValue64(i); } | 306 void AddValue64(int64_t i) const { stream_->PrintValue64(i); } |
302 void AddValueTimeMillis(int64_t millis) const { | 307 void AddValueTimeMillis(int64_t millis) const { |
303 stream_->PrintValueTimeMillis(millis); | 308 stream_->PrintValueTimeMillis(millis); |
304 } | 309 } |
| 310 void AddValueTimeMicros(int64_t micros) const { |
| 311 stream_->PrintValueTimeMicros(micros); |
| 312 } |
305 void AddValue(double d) const { stream_->PrintValue(d); } | 313 void AddValue(double d) const { stream_->PrintValue(d); } |
306 void AddValue(const char* s) const { stream_->PrintValue(s); } | 314 void AddValue(const char* s) const { stream_->PrintValue(s); } |
307 void AddValue(const Object& obj, bool ref = true) const { | 315 void AddValue(const Object& obj, bool ref = true) const { |
308 stream_->PrintValue(obj, ref); | 316 stream_->PrintValue(obj, ref); |
309 } | 317 } |
310 void AddValue(Isolate* isolate, bool ref = true) const { | 318 void AddValue(Isolate* isolate, bool ref = true) const { |
311 stream_->PrintValue(isolate, ref); | 319 stream_->PrintValue(isolate, ref); |
312 } | 320 } |
313 void AddValue(Breakpoint* bpt) const { | 321 void AddValue(Breakpoint* bpt) const { |
314 stream_->PrintValue(bpt); | 322 stream_->PrintValue(bpt); |
(...skipping 17 matching lines...) Expand all Loading... |
332 | 340 |
333 friend class JSONObject; | 341 friend class JSONObject; |
334 | 342 |
335 DISALLOW_ALLOCATION(); | 343 DISALLOW_ALLOCATION(); |
336 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 344 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
337 }; | 345 }; |
338 | 346 |
339 } // namespace dart | 347 } // namespace dart |
340 | 348 |
341 #endif // VM_JSON_STREAM_H_ | 349 #endif // VM_JSON_STREAM_H_ |
OLD | NEW |