Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: runtime/vm/json_stream.h

Issue 18168003: JSONStream and tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/json_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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();
19
20 void OpenObject(const char* property_name = NULL);
21 void CloseObject();
22
23 void OpenArray(const char* property_name = NULL);
24 void CloseArray();
25
26 void PrintValueBool(bool b);
27 void PrintValue(intptr_t 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, intptr_t i);
33 void PrintProperty(const char* name, double d);
34 void PrintProperty(const char* name, const char* s);
35
36 private:
37 void PrintPropertyName(const char* name);
38 void PrintCommaIfNeeded();
39 bool NeedComma();
40 intptr_t open_objects_;
41 TextBuffer* buffer_;
42 };
43
44 } // namespace dart
45
46 #endif // VM_JSON_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/json_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698