writeValue method

String writeValue(
  1. VlJson v,
  2. int depth,
  3. bool pretty
)

Implementation

String writeValue(VlJson v, int depth, bool pretty) {
  if ( v.kind == 0 ) {
    return "null";
  }
  if ( v.kind == 1 ) {
    if ( v.b ) {
      return "true";
    }
    return "false";
  }
  if ( v.kind == 2 ) {
    return VlJson.formatNumber(v.num, decimals);
  }
  if ( v.kind == 3 ) {
    return this.quote(v.str);
  }
  if ( v.kind == 4 ) {
    return this.writeArray(v, depth, pretty);
  }
  return this.writeObject(v, depth, pretty);
}