Chromium Code Reviews| 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 "platform/json.h" | 8 #include "platform/json.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 void PrintValue(const Object& o, bool ref = true); | 32 void PrintValue(const Object& o, bool ref = true); |
| 33 | 33 |
| 34 void PrintPropertyBool(const char* name, bool b); | 34 void PrintPropertyBool(const char* name, bool b); |
| 35 void PrintProperty(const char* name, intptr_t i); | 35 void PrintProperty(const char* name, intptr_t i); |
| 36 void PrintProperty(const char* name, double d); | 36 void PrintProperty(const char* name, double d); |
| 37 void PrintProperty(const char* name, const char* s); | 37 void PrintProperty(const char* name, const char* s); |
| 38 void PrintfProperty(const char* name, const char* format, ...) | 38 void PrintfProperty(const char* name, const char* format, ...) |
| 39 PRINTF_ATTRIBUTE(3, 4); | 39 PRINTF_ATTRIBUTE(3, 4); |
| 40 void PrintProperty(const char* name, const Object& o, bool ref = true); | 40 void PrintProperty(const char* name, const Object& o, bool ref = true); |
| 41 | 41 |
| 42 void SetArguments(const char** arguments, intptr_t num_arguments); | |
| 43 void SetOptions(const char** option_keys, const char** option_values, | |
| 44 intptr_t num_options); | |
| 45 | |
| 46 intptr_t num_arguments() const { return num_arguments_; } | |
| 47 const char* GetArgument(intptr_t i) { | |
|
siva
2013/08/06 00:02:52
const
Cutch
2013/08/06 14:46:11
Done.
| |
| 48 return arguments_[i]; | |
| 49 } | |
| 50 intptr_t num_options() const { return num_options_; } | |
| 51 const char* GetOptionKey(intptr_t i) { | |
|
siva
2013/08/06 00:02:52
const
Cutch
2013/08/06 14:46:11
Done.
| |
| 52 return option_keys_[i]; | |
| 53 } | |
| 54 const char* GetOptionValue(intptr_t i) { | |
|
siva
2013/08/06 00:02:52
const
Cutch
2013/08/06 14:46:11
Done.
| |
| 55 return option_values_[i]; | |
| 56 } | |
| 57 | |
| 42 private: | 58 private: |
| 43 void PrintPropertyName(const char* name); | 59 void PrintPropertyName(const char* name); |
| 44 void PrintCommaIfNeeded(); | 60 void PrintCommaIfNeeded(); |
| 45 bool NeedComma(); | 61 bool NeedComma(); |
| 46 intptr_t open_objects_; | 62 intptr_t open_objects_; |
| 47 TextBuffer* buffer_; | 63 TextBuffer* buffer_; |
| 64 const char** arguments_; | |
| 65 intptr_t num_arguments_; | |
| 66 const char** option_keys_; | |
| 67 const char** option_values_; | |
| 68 intptr_t num_options_; | |
| 48 }; | 69 }; |
| 49 | 70 |
| 50 } // namespace dart | 71 } // namespace dart |
| 51 | 72 |
| 52 #endif // VM_JSON_STREAM_H_ | 73 #endif // VM_JSON_STREAM_H_ |
| OLD | NEW |