Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VM_JSON_STREAM_H_ | |
| 6 #define VM_JSON_STREAM_H_ | |
| 7 | |
| 8 #include "platform/json.h" | |
| 9 | |
| 10 namespace dart { | |
| 11 | |
| 12 | |
| 13 class JSONStream : ValueObject { | |
| 14 public: | |
| 15 explicit JSONStream(TextBuffer* buffer); | |
| 16 ~JSONStream(); | |
| 17 | |
| 18 void Clear(); | |
|
Ivan Posva
2013/07/01 23:18:14
When do you expect to ever have to call Clear() on
Cutch
2013/07/01 23:33:55
Possibly never. I can remove this.
| |
| 19 | |
| 20 void OpenObject(); | |
| 21 void CloseObject(); | |
| 22 | |
| 23 void OpenArray(); | |
| 24 void CloseArray(); | |
| 25 | |
| 26 void PrintValueBool(bool b); | |
| 27 void PrintValue(int i); | |
| 28 void PrintValue(double d); | |
| 29 void PrintValue(const char* s); | |
| 30 | |
| 31 void PrintPropertyBool(const char* name, bool b); | |
| 32 void PrintProperty(const char* name, int i); | |
| 33 void PrintProperty(const char* name, double d); | |
| 34 void PrintProperty(const char* name, const char* s); | |
| 35 | |
| 36 void PrintPropertyName(const char* name); | |
|
Ivan Posva
2013/07/01 23:18:14
Shouldn't this be a private?
Cutch
2013/07/01 23:33:55
Not without a change to OpenObject. This is neede
| |
| 37 | |
| 38 private: | |
| 39 void PrintCommaIfNeeded(); | |
| 40 bool NeedComma(); | |
| 41 intptr_t open_objects_; | |
| 42 TextBuffer* buffer_; | |
| 43 }; | |
| 44 | |
| 45 } // namespace dart | |
| 46 | |
| 47 #endif // VM_JSON_STREAM_H_ | |
| OLD | NEW |