MySQL: sql/json_dom.h File Reference

MySQL: sql/json_dom.h File Reference MySQL  8.0.0 Source Code Documentation Main Page Related Pages Modules Namespaces Classes Files File List File Members Classes | Macros | Typedefs | Enumerations | Functions json_dom.h File Reference JSON DOM. More... #include " my_global.h " #include " malloc_allocator.h " #include " my_decimal.h " #include " binary_log_types.h " #include " mysql_time.h " #include " json_binary.h " #include " sql_alloc.h " #include " prealloced_array.h " #include <map> #include <string> #include <type_traits> Go to the source code of this file. Classes class   Json_dom   JSON DOM abstract base class. More...   struct   Json_key_comparator   A comparator that is used for ordering keys in a Json_object . More...   class   Json_object   Represents a JSON container value of type "object" (ECMA), type J_OBJECT here. More...   class   Json_array   Represents a JSON array container, i.e. More...   class   Json_scalar   Abstract base class for all Json scalars. More...   class   Json_string   Represents a JSON string value (ECMA), of type J_STRING here. More...   class   Json_number   Abstract base class of all JSON number (ECMA) types (subclasses represent MySQL extensions). More...   class   Json_decimal   Represents a MySQL decimal number, type J_DECIMAL. More...   class   Json_double   Represents a MySQL double JSON scalar (an extension of the ECMA number value), type J_DOUBLE. More...   class   Json_int   Represents a MySQL integer (64 bits signed) JSON scalar (an extension of the ECMA number value), type J_INT. More...   class   Json_uint   Represents a MySQL integer (64 bits unsigned) JSON scalar (an extension of the ECMA number value), type J_UINT. More...   class   Json_null   Represents a JSON null type (ECMA), type J_NULL here. More...   class   Json_datetime   Represents a MySQL date/time value (DATE, TIME, DATETIME or TIMESTAMP) - an extension to the ECMA set of JSON scalar types, types J_DATE, J_TIME, J_DATETIME and J_TIMESTAMP respectively. More...   class   Json_opaque   Represents a MySQL value opaquely, i.e. More...   class   Json_boolean   Represents a JSON true or false value, type J_BOOLEAN here. More...   class   Json_wrapper_object_iterator   class   Json_wrapper   Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON values or JSON DOM values. More...   class   Json_scalar_holder   A class that is capable of holding objects of any sub-type of Json_scalar . More...   union   Json_scalar_holder::Any_json_scalar   Union of all concrete subclasses of Json_scalar . More...   Macros #define  JSON_DOCUMENT_MAX_DEPTH    100   The maximum number of nesting levels allowed in a JSON document. More...   Typedefs typedef Prealloced_array < Json_wrapper , 16, false >  Json_wrapper_vector   typedef Prealloced_array < Json_dom *, 16 >  Json_dom_vector   typedef std::map < std::string, Json_dom *, Json_key_comparator , Malloc_allocator < std::pair< std::string, Json_dom * > > >  Json_object_map   A type used to hold JSON object elements in a map, see the Json_object class. More...   Enumerations enum   enum_json_type {    enum_json_type::J_NULL , enum_json_type::J_DECIMAL , enum_json_type::J_INT , enum_json_type::J_UINT ,    enum_json_type::J_DOUBLE , enum_json_type::J_STRING , enum_json_type::J_OBJECT , enum_json_type::J_ARRAY ,    enum_json_type::J_BOOLEAN , enum_json_type::J_DATE , enum_json_type::J_TIME , enum_json_type::J_DATETIME ,    enum_json_type::J_TIMESTAMP , enum_json_type::J_OPAQUE , enum_json_type::J_ERROR }   Json values in MySQL comprises the stand set of JSON values plus a MySQL specific set. More...   Functions bool  double_quote (const char *cptr, size_t length, String *buf)   Function for double-quoting a string and escaping characters to make up a valid EMCA Json text. More...   Json_dom *  merge_doms ( Json_dom *left, Json_dom *right)   Merge two doms. More...   bool  is_valid_json_syntax (const char *text, size_t length)   Check if a string contains valid JSON text, without generating a Json_dom representation of the document. More...   Detailed Description JSON DOM. When a JSON value is retrieved from a column, a prior it exists in a binary form, cf. Json_binary::Value class. However, when we need to manipulate the JSON values we mostly convert them from binary form to a structured in-memory from called DOM (from domain object model) which uses a recursive tree representation of the JSON value corresponding closely to a parse tree. This form is more suitable for manipulation. The JSON type is mostly represented internally as a Json_wrapper which hides if the representation is a binary or DOM one. This makes is possible to avoid building a DOM unless we really need one. The file defines two sets of classes: a) The Json_dom hierarchy and b) Json_wrapper and its companion class Json_wrapper_object_iterator . For both sets, arrays are traversed using an operator[]. Macro Definition Documentation #define JSON_DOCUMENT_MAX_D