PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ array_dim_to_json()

static void array_dim_to_json ( StringInfo  result,
int  dim,
int  ndims,
int *  dims,
Datum *  vals,
bool *  nulls,
int *  valcount,
JsonTypeCategory  tcategory,
Oid  outfuncoid,
bool  use_line_feeds 
)
static

Definition at line 608 of file lwgeom_out_geojson.c.

611 {
612  int i;
613  const char *sep;
614 
615  Assert(dim < ndims);
616 
617  sep = use_line_feeds ? ",\n " : ",";
618 
619  appendStringInfoChar(result, '[');
620 
621  for (i = 1; i <= dims[dim]; i++)
622  {
623  if (i > 1)
624  appendStringInfoString(result, sep);
625 
626  if (dim + 1 == ndims)
627  {
628  datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
629  outfuncoid, false);
630  (*valcount)++;
631  }
632  else
633  {
634  /*
635  * Do we want line feeds on inner dimensions of arrays? For now
636  * we'll say no.
637  */
638  array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
639  valcount, tcategory, outfuncoid, false);
640  }
641  }
642 
643  appendStringInfoChar(result, ']');
644 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
static void array_dim_to_json(StringInfo result, int dim, int ndims, int *dims, Datum *vals, bool *nulls, int *valcount, JsonTypeCategory tcategory, Oid outfuncoid, bool use_line_feeds)
static void datum_to_json(Datum val, bool is_null, StringInfo result, JsonTypeCategory tcategory, Oid outfuncoid, bool key_scalar)

References datum_to_json(), and result.

Referenced by array_to_json_internal().

Here is the call graph for this function:
Here is the caller graph for this function: