File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,23 @@ void SensorDataTransformer::processStdinDataJson(const std::vector<std::string>&
228228 writeJsonObject (reading, outfile, removeWhitespace);
229229 outfile << sp << " ]" ;
230230 }
231+ } else {
232+ // JSON input format (including "auto" which defaults to JSON for stdin)
233+ for (const auto & line : lines) {
234+ if (line.empty ()) continue ;
235+
236+ auto readings = JsonParser::parseJsonLine (line);
237+ for (const auto & reading : readings) {
238+ if (reading.empty ()) continue ;
239+ if (!shouldOutputReading (reading)) continue ;
240+
241+ if (!firstOutput) outfile << " \n " ;
242+ firstOutput = false ;
243+ outfile << " [" << sp;
244+ writeJsonObject (reading, outfile, removeWhitespace);
245+ outfile << sp << " ]" ;
246+ }
247+ }
231248 }
232249}
233250
You can’t perform that action at this time.
0 commit comments