Beispiel #1
0
void Option::writeDoubles(JSON::Sink &sink, const string &value,
                          const string &delims) {
  doubles_t l = parseDoubles(value, delims);

  sink.beginList();
  for (unsigned i = 0; i < value.size(); i++) {
    sink.beginAppend();
    sink.append(l[i]);
  }
  sink.endList();
}
Beispiel #2
0
void Option::writeIntegers(JSON::Sink &sink, const string &value,
                           const string &delims) {
  integers_t l = parseIntegers(value, delims);

  sink.beginList();
  for (unsigned i = 0; i < l.size(); i++) {
    sink.beginAppend();
    if (JSON_MIN_INT < l[i] && l[i] < JSON_MAX_INT) sink.write(l[i]);
    else sink.write(SSTR("0x" << hex << l[i]));
  }
  sink.endList();
}