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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void PrintValue(double d); | 86 void PrintValue(double d); |
87 void PrintValue(const char* s); | 87 void PrintValue(const char* s); |
88 void PrintValue(const char* s, intptr_t len); | 88 void PrintValue(const char* s, intptr_t len); |
89 void PrintValueNoEscape(const char* s); | 89 void PrintValueNoEscape(const char* s); |
90 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 90 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
91 void PrintValue(const Object& o, bool ref = true); | 91 void PrintValue(const Object& o, bool ref = true); |
92 void PrintValue(SourceBreakpoint* bpt); | 92 void PrintValue(SourceBreakpoint* bpt); |
93 void PrintValue(const DebuggerEvent* event); | 93 void PrintValue(const DebuggerEvent* event); |
94 void PrintValue(Metric* metric); | 94 void PrintValue(Metric* metric); |
95 void PrintValue(Isolate* isolate, bool ref = true); | 95 void PrintValue(Isolate* isolate, bool ref = true); |
| 96 bool PrintValueStr(const String& s, intptr_t limit); |
96 | 97 |
97 void PrintPropertyBool(const char* name, bool b); | 98 void PrintPropertyBool(const char* name, bool b); |
98 void PrintProperty(const char* name, intptr_t i); | 99 void PrintProperty(const char* name, intptr_t i); |
99 void PrintProperty64(const char* name, int64_t i); | 100 void PrintProperty64(const char* name, int64_t i); |
100 void PrintProperty(const char* name, double d); | 101 void PrintProperty(const char* name, double d); |
101 void PrintProperty(const char* name, const char* s); | 102 void PrintProperty(const char* name, const char* s); |
102 void PrintProperty(const char* name, const char* s, intptr_t len); | 103 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); |
103 void PrintPropertyNoEscape(const char* name, const char* s); | 104 void PrintPropertyNoEscape(const char* name, const char* s); |
104 void PrintfProperty(const char* name, const char* format, ...) | 105 void PrintfProperty(const char* name, const char* format, ...) |
105 PRINTF_ATTRIBUTE(3, 4); | 106 PRINTF_ATTRIBUTE(3, 4); |
106 void PrintProperty(const char* name, const Object& o, bool ref = true); | 107 void PrintProperty(const char* name, const Object& o, bool ref = true); |
107 | 108 |
108 void PrintProperty(const char* name, const DebuggerEvent* event); | 109 void PrintProperty(const char* name, const DebuggerEvent* event); |
109 void PrintProperty(const char* name, SourceBreakpoint* bpt); | 110 void PrintProperty(const char* name, SourceBreakpoint* bpt); |
110 void PrintProperty(const char* name, Metric* metric); | 111 void PrintProperty(const char* name, Metric* metric); |
111 void PrintProperty(const char* name, Isolate* isolate); | 112 void PrintProperty(const char* name, Isolate* isolate); |
112 void PrintPropertyName(const char* name); | 113 void PrintPropertyName(const char* name); |
113 void PrintCommaIfNeeded(); | 114 void PrintCommaIfNeeded(); |
114 bool NeedComma(); | 115 bool NeedComma(); |
115 | 116 |
| 117 bool AddDartString(const String& s, intptr_t limit); |
116 void AddEscapedUTF8String(const char* s); | 118 void AddEscapedUTF8String(const char* s); |
117 void AddEscapedUTF8String(const char* s, intptr_t len); | 119 void AddEscapedUTF8String(const char* s, intptr_t len); |
118 | 120 |
119 intptr_t nesting_level() const { return open_objects_; } | 121 intptr_t nesting_level() const { return open_objects_; } |
120 | 122 |
121 intptr_t open_objects_; | 123 intptr_t open_objects_; |
122 TextBuffer buffer_; | 124 TextBuffer buffer_; |
123 Dart_Port reply_port_; | 125 Dart_Port reply_port_; |
124 const char* command_; | 126 const char* command_; |
125 const char** arguments_; | 127 const char** arguments_; |
(...skipping 30 matching lines...) Expand all Loading... |
156 } | 158 } |
157 void AddProperty64(const char* name, int64_t i) const { | 159 void AddProperty64(const char* name, int64_t i) const { |
158 stream_->PrintProperty64(name, i); | 160 stream_->PrintProperty64(name, i); |
159 } | 161 } |
160 void AddProperty(const char* name, double d) const { | 162 void AddProperty(const char* name, double d) const { |
161 stream_->PrintProperty(name, d); | 163 stream_->PrintProperty(name, d); |
162 } | 164 } |
163 void AddProperty(const char* name, const char* s) const { | 165 void AddProperty(const char* name, const char* s) const { |
164 stream_->PrintProperty(name, s); | 166 stream_->PrintProperty(name, s); |
165 } | 167 } |
166 void AddProperty(const char* name, const char* s, intptr_t len) const { | 168 bool AddPropertyStr(const char* name, |
167 stream_->PrintProperty(name, s, len); | 169 const String& s, |
| 170 intptr_t limit = -1) const { |
| 171 return stream_->PrintPropertyStr(name, s, limit); |
168 } | 172 } |
169 void AddPropertyNoEscape(const char* name, const char* s) const { | 173 void AddPropertyNoEscape(const char* name, const char* s) const { |
170 stream_->PrintPropertyNoEscape(name, s); | 174 stream_->PrintPropertyNoEscape(name, s); |
171 } | 175 } |
172 void AddProperty(const char* name, const Object& obj, bool ref = true) const { | 176 void AddProperty(const char* name, const Object& obj, bool ref = true) const { |
173 stream_->PrintProperty(name, obj, ref); | 177 stream_->PrintProperty(name, obj, ref); |
174 } | 178 } |
175 void AddProperty(const char* name, const DebuggerEvent* event) const { | 179 void AddProperty(const char* name, const DebuggerEvent* event) const { |
176 stream_->PrintProperty(name, event); | 180 stream_->PrintProperty(name, event); |
177 } | 181 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 243 |
240 friend class JSONObject; | 244 friend class JSONObject; |
241 | 245 |
242 DISALLOW_ALLOCATION(); | 246 DISALLOW_ALLOCATION(); |
243 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 247 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
244 }; | 248 }; |
245 | 249 |
246 } // namespace dart | 250 } // namespace dart |
247 | 251 |
248 #endif // VM_JSON_STREAM_H_ | 252 #endif // VM_JSON_STREAM_H_ |
OLD | NEW |