PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 553 of file lwgeom_out_geojson.c.

556{
557 int i;
558 const char *sep;
559
560 Assert(dim < ndims);
561
562 sep = use_line_feeds ? ",\n " : ",";
563
564 appendStringInfoChar(result, '[');
565
566 for (i = 1; i <= dims[dim]; i++)
567 {
568 if (i > 1)
569 appendStringInfoString(result, sep);
570
571 if (dim + 1 == ndims)
572 {
573 datum_to_json(vals[*valcount], nulls[*valcount], result, tcategory,
574 outfuncoid, false);
575 (*valcount)++;
576 }
577 else
578 {
579 /*
580 * Do we want line feeds on inner dimensions of arrays? For now
581 * we'll say no.
582 */
583 array_dim_to_json(result, dim + 1, ndims, dims, vals, nulls,
584 valcount, tcategory, outfuncoid, false);
585 }
586 }
587
588 appendStringInfoChar(result, ']');
589}
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 array_dim_to_json(), and datum_to_json().

Referenced by array_dim_to_json(), and array_to_json_internal().

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