MCPcopy Create free account
hub / github.com/apache/cloudberry / jsonPathToCstring

Function jsonPathToCstring

src/backend/utils/adt/jsonpath.c:202–222  ·  view source on GitHub ↗

* Converts jsonpath value to a C-string. * * If 'out' argument is non-null, the resulting C-string is stored inside the * StringBuffer. The resulting string is always returned. */

Source from the content-addressed store, hash-verified

200 * StringBuffer. The resulting string is always returned.
201 */
202static char *
203jsonPathToCstring(StringInfo out, JsonPath *in, int estimated_len)
204{
205 StringInfoData buf;
206 JsonPathItem v;
207
208 if (!out)
209 {
210 out = &buf;
211 initStringInfo(out);
212 }
213 enlargeStringInfo(out, estimated_len);
214
215 if (!(in->header & JSONPATH_LAX))
216 appendBinaryStringInfo(out, "strict ", 7);
217
218 jspInit(&v, in);
219 printJsonPathItem(out, &v, false, true);
220
221 return out->data;
222}
223
224/*
225 * Recursive function converting given jsonpath parse item and all its

Callers 2

jsonpath_outFunction · 0.85
jsonpath_sendFunction · 0.85

Calls 5

initStringInfoFunction · 0.85
enlargeStringInfoFunction · 0.85
appendBinaryStringInfoFunction · 0.85
jspInitFunction · 0.85
printJsonPathItemFunction · 0.85

Tested by

no test coverage detected