MySQL 9.1.0
Source Code Documentation
|
A JSON path expression. More...
#include <json_path.h>
Public Member Functions | |
Json_path (PSI_memory_key key) | |
~Json_path () | |
Json_path (Json_path &&other) | |
Move constructor. More... | |
Json_path & | operator= (Json_path &&other) |
Move assignment. More... | |
bool | append (const Json_path_leg &leg) |
Add a path leg to the end of this path. More... | |
void | clear () |
Resets this to an empty path with no legs. More... | |
bool | can_match_many () const |
Return true if the path can match more than one value in a JSON document. More... | |
bool | to_string (String *buf) const |
Turn into a human-readable string. More... | |
Public Member Functions inherited from Json_seekable_path | |
size_t | leg_count () const |
Return the number of legs in this searchable path. More... | |
Json_path_iterator | begin () const |
Get an iterator pointing to the first path leg. More... | |
Json_path_iterator | end () const |
Get an iterator pointing just past the last path leg. More... | |
const Json_path_leg * | last_leg () const |
Get a pointer to the last path leg. More... | |
Private Attributes | |
MEM_ROOT | m_mem_root |
A MEM_ROOT in which the Json_path_leg objects pointed to by Json_seekable_path::m_path_legs are allocated. More... | |
PSI_memory_key | m_psi_key |
Key used to instrument memory usage. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Json_seekable_path | |
Json_seekable_path (PSI_memory_key key) | |
Protected Attributes inherited from Json_seekable_path | |
Json_path_leg_pointers | m_path_legs |
An array of pointers to the legs of the JSON path. More... | |
A JSON path expression.
From the user's point of view, a path expression is a string literal with the following structure. We parse this structure into a Json_path object:
pathExpression ::= scope pathLeg (pathLeg)* scope ::= dollarSign pathLeg ::= member | arrayLocation | doubleAsterisk member ::= period (keyName | asterisk) arrayLocation ::= leftBracket (arrayIndex | arrayRange | asterisk) rightBracket arrayIndex ::= non-negative-integer | last [ minus non-negative-integer ] arrayRange ::= arrayIndex to arrayIndex keyName ::= ECMAScript-identifier | ECMAScript-string-literal doubleAsterisk ::= ** to ::= "to" last ::= "last"
|
explicit |
|
inline |
|
inline |
Move constructor.
|
inline |
Add a path leg to the end of this path.
[in] | leg | the leg to add |
bool Json_path::can_match_many | ( | ) | const |
Return true if the path can match more than one value in a JSON document.
true | if the path contains a path leg which is a wildcard, ellipsis or array range |
false | otherwise |
|
inline |
Resets this to an empty path with no legs.
bool Json_path::to_string | ( | String * | buf | ) | const |
Turn into a human-readable string.
|
private |
A MEM_ROOT in which the Json_path_leg objects pointed to by Json_seekable_path::m_path_legs are allocated.
|
private |
Key used to instrument memory usage.