Index: runtime/vm/json_stream.cc |
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc |
index 4962f0317b4365cd9abe13b7f6618925a0e86fbd..fe556036b72907c173d0d928e9cfb5369611756f 100644 |
--- a/runtime/vm/json_stream.cc |
+++ b/runtime/vm/json_stream.cc |
@@ -139,6 +139,20 @@ const char* JSONStream::LookupOption(const char* key) const { |
} |
+bool JSONStream::HasOption(const char* key) const { |
+ ASSERT(key); |
+ return LookupOption(key) != NULL; |
+} |
+ |
+ |
+bool JSONStream::OptionIs(const char* key, const char* value) const { |
+ ASSERT(key); |
+ ASSERT(value); |
+ const char* key_value = LookupOption(key); |
+ return (key_value != NULL) && (strcmp(key_value, value) == 0); |
+} |
turnidge
2014/04/01 20:23:28
Consider adding a heartbeat unit test for these tw
Cutch
2014/04/01 22:01:14
Added a test for options and arguments in JSONStre
|
+ |
+ |
void JSONStream::Clear() { |
buffer_.Clear(); |
open_objects_ = 0; |