File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,19 @@ bool StreamCommand::execute(const String& command,
23
23
}
24
24
25
25
bool running = true ;
26
+ DynamicJsonBuffer buffer;
26
27
while (running) {
27
28
if (stream->available ()) {
28
29
std::string json;
29
30
FirebaseStream::Event event = stream->read (json);
30
31
out->print (" +" );
31
32
out->print (FirebaseStream::EventToName (event).c_str ());
32
33
out->print (" " );
33
- // TODO(edcoyne): add json parsing and get real path.
34
- out->println (" /dummy/path" );
35
- out->println (json.length ());
36
- out->println (json.c_str ());
34
+ const auto & object = buffer.parseObject (json.c_str ());
35
+ String data = object[" data" ];
36
+ out->println (object[" path" ].asString ());
37
+ out->println (data.length ());
38
+ out->println (data);
37
39
} else if (in->available ()) {
38
40
String command = in->readLine ();
39
41
if (command == " END_STREAM" ) {
You can’t perform that action at this time.
0 commit comments