comparison runner/JAMSFeatureWriter.cpp @ 192:bb295c0feb3e

Fix JSON validity
author Chris Cannam
date Wed, 22 Jul 2015 14:34:26 +0100
parents 089f1a13963d
children 3b7ec45abd1c
comparison
equal deleted inserted replaced
191:4ef452f5fefc 192:bb295c0feb3e
145 145
146 if (f.values.size() > 0) { 146 if (f.values.size() > 0) {
147 d += QString(", \"value\": [ "); 147 d += QString(", \"value\": [ ");
148 for (int j = 0; j < int(f.values.size()); ++j) { 148 for (int j = 0; j < int(f.values.size()); ++j) {
149 if (isnan(f.values[j])) { 149 if (isnan(f.values[j])) {
150 d += "\"NaN\" "; 150 d += "\"NaN\"";
151 } else if (isinf(f.values[j])) { 151 } else if (isinf(f.values[j])) {
152 d += "\"Inf\" "; 152 d += "\"Inf\"";
153 } else { 153 } else {
154 d += QString("%1 ").arg(f.values[j]); 154 d += QString("%1").arg(f.values[j]);
155 } 155 }
156 } 156 if (j + 1 < int(f.values.size())) {
157 d += "]"; 157 d += ", ";
158 }
159 }
160 d += " ]";
158 } 161 }
159 162
160 d += " }"; 163 d += " }";
161 } 164 }
162 165