PostGIS  3.4.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 574 of file lwgeom_out_geojson.c.

577 {
578  int i;
579  const char *sep;
580 
581  Assert(dim < ndims);
582 
583  sep = use_line_feeds ? ",\n " : ",";
584 
585  appendStringInfoChar(result, '[');
586 
587  for (i = 1; i <= dims[dim]; i++)
588  {
589  if (i > 1)
590  appendStringInfoString(result, sep);
591 
592  if (dim + 1 == ndims)
593  {
594  datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
595  outfuncoid, false);
596  (*valcount)++;
597  }
598  else
599  {
600  /*
601  * Do we want line feeds on inner dimensions of arrays? For now
602  * we'll say no.
603  */
604  array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
605  valcount, tcategory, outfuncoid, false);
606  }
607  }
608 
609  appendStringInfoChar(result, ']');
610 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
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: