* 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. */
| 200 | * StringBuffer. The resulting string is always returned. |
| 201 | */ |
| 202 | static char * |
| 203 | jsonPathToCstring(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 |
no test coverage detected