StdioStream::Ptr sfp = new StdioStream(&fp, false);
int typeL = 0, countTotal = 0;
+
String message;
StreamReadContext src;
+ for (;;) {
+ StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
+
+ if (srs == StatusEof)
+ break;
+
+ if (srs != StatusNewItem)
+ continue;
- while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
Dictionary::Ptr object = JsonDecode(message);
Dictionary::Ptr properties = object->Get("properties");
String message;
StreamReadContext src;
+ for (;;) {
+ StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
+
+ if (srs == StatusEof)
+ break;
+
+ if (srs != StatusNewItem)
+ continue;
- while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
Dictionary::Ptr variable = JsonDecode(message);
if (variable->Get("name") == name) {
String message;
StreamReadContext src;
+ for (;;) {
+ StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
+
+ if (srs == StatusEof)
+ break;
+
+ if (srs != StatusNewItem)
+ continue;
- while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
Dictionary::Ptr variable = JsonDecode(message);
outfp << variable->Get("name") << " = " << variable->Get("value") << "\n";
variables_count++;