MySQL 9.1.0
Source Code Documentation
Json_key_comparator Struct Reference

A comparator that is used for ordering keys in a Json_object. More...

#include <json_dom.h>

Public Types

using is_transparent = void
 

Public Member Functions

bool operator() (std::string_view key1, std::string_view key2) const
 Compare two keys from a JSON object and determine whether or not the first key is less than the second key. More...
 

Detailed Description

A comparator that is used for ordering keys in a Json_object.

It orders the keys on length, and lexicographically if the keys have the same length. The ordering is ascending. This ordering was chosen for speed of look-up. See usage in Json_object_map.

Member Typedef Documentation

◆ is_transparent

Member Function Documentation

◆ operator()()

bool Json_key_comparator::operator() ( std::string_view  key1,
std::string_view  key2 
) const

Compare two keys from a JSON object and determine whether or not the first key is less than the second key.

key1 is considered less than key2 if

a) key1 is shorter than key2, or if

b) key1 and key2 have the same length, but different contents, and the first byte that differs has a smaller value in key1 than in key2

Otherwise, key1 is not less than key2.

Parameters
key1the first key to compare
key2the second key to compare
Returns
true if key1 is considered less than key2, false otherwise

The documentation for this struct was generated from the following files: