CUBRID Engine
latest
|
#include "db_json_path.hpp"
#include "db_json.hpp"
#include "db_rapidjson.hpp"
#include "memory_alloc.h"
#include "string_opfunc.h"
#include "system_parameter.h"
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cstdlib>
#include <limits>
#include <string>
#include <unordered_set>
#include <vector>
Go to the source code of this file.
Enumerations | |
enum | JSON_PATH_TYPE { JSON_PATH_TYPE::JSON_PATH_SQL_JSON, JSON_PATH_TYPE::JSON_PATH_POINTER } |
Functions | |
static void | db_json_trim_leading_spaces (std::string &path_string) |
static JSON_PATH_TYPE | db_json_get_path_type (std::string &path_string) |
static bool | db_json_isspace (const unsigned char &ch) |
static std::size_t | skip_whitespaces (const std::string &path, std::size_t token_begin) |
static int | db_json_path_is_token_valid_array_index (const std::string &str, bool allow_wildcards, unsigned long &index, std::size_t start=0, std::size_t end=0) |
static bool | db_json_path_is_token_valid_quoted_object_key (const std::string &path, std::size_t &token_begin) |
static bool | db_json_path_quote_and_validate_unquoted_object_key (std::string &path, std::size_t &token_begin) |
static bool | db_json_path_is_token_valid_unquoted_object_key (const std::string &path, std::size_t &token_begin) |
static bool | db_json_path_is_valid_identifier_start_char (unsigned char ch) |
static bool | db_json_path_is_valid_identifier_char (unsigned char ch) |
static void | db_json_remove_leading_zeros_index (std::string &index) |
static bool | db_json_iszero (const unsigned char &ch) |
int | db_json_split_path_by_delimiters (const std::string &path, const std::string &delim, bool allow_empty, std::vector< std::string > &split_path) |
int | db_json_path_unquote_object_keys (std::string &sql_path) |
|
strong |
Enumerator | |
---|---|
JSON_PATH_SQL_JSON | |
JSON_PATH_POINTER |
Definition at line 36 of file db_json_path.cpp.
|
static |
Definition at line 287 of file db_json_path.cpp.
References db_json_trim_leading_spaces(), JSON_PATH_POINTER, and JSON_PATH_SQL_JSON.
Referenced by JSON_PATH::parse().
Definition at line 273 of file db_json_path.cpp.
Referenced by db_json_trim_leading_spaces().
Definition at line 57 of file db_json_path.cpp.
Referenced by db_json_remove_leading_zeros_index().
|
static |
Definition at line 195 of file db_json_path.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_JSON_ARRAY_INDEX_TOO_LARGE, ER_JSON_INVALID_PATH, er_set(), NO_ERROR, prm_get_integer_value(), and PRM_ID_JSON_MAX_ARRAY_IDX.
Referenced by db_json_split_path_by_delimiters(), and JSON_PATH::validate_and_create_from_json_path().
|
static |
Definition at line 70 of file db_json_path.cpp.
References i, and skip_whitespaces().
Referenced by JSON_PATH::validate_and_create_from_json_path().
|
static |
Definition at line 150 of file db_json_path.cpp.
References db_json_path_is_valid_identifier_char(), db_json_path_is_valid_identifier_start_char(), and i.
Referenced by db_json_path_quote_and_validate_unquoted_object_key(), and db_json_path_unquote_object_keys().
|
static |
Definition at line 130 of file db_json_path.cpp.
Referenced by db_json_path_is_token_valid_unquoted_object_key().
|
static |
Definition at line 120 of file db_json_path.cpp.
Referenced by db_json_path_is_token_valid_unquoted_object_key().
|
static |
Definition at line 104 of file db_json_path.cpp.
References db_json_path_is_token_valid_unquoted_object_key(), i, and skip_whitespaces().
Referenced by JSON_PATH::validate_and_create_from_json_path().
int db_json_path_unquote_object_keys | ( | std::string & | sql_path | ) |
Definition at line 554 of file db_json_path.cpp.
References assert, ASSERT_ERROR, db_json_path_is_token_valid_unquoted_object_key(), db_json_split_path_by_delimiters(), i, and NO_ERROR.
Referenced by db_json_path_unquote_object_keys_external().
|
static |
Definition at line 602 of file db_json_path.cpp.
References db_json_iszero().
Referenced by db_json_split_path_by_delimiters().
int db_json_split_path_by_delimiters | ( | const std::string & | path, |
const std::string & | delim, | ||
bool | allow_empty, | ||
std::vector< std::string > & | split_path | ||
) |
Definition at line 434 of file db_json_path.cpp.
References ARG_FILE_LINE, assert, db_json_path_is_token_valid_array_index(), db_json_remove_leading_zeros_index(), PATH_TOKEN::double_wildcard, er_clear(), ER_ERROR_SEVERITY, ER_JSON_INVALID_PATH, er_set(), i, JSON_PATH::m_path_tokens, PATH_TOKEN::match_pattern(), JSON_PATH::match_pattern(), and NO_ERROR.
Referenced by db_json_path_unquote_object_keys().
|
static |
Definition at line 279 of file db_json_path.cpp.
References db_json_isspace().
Referenced by db_json_get_path_type(), and JSON_PATH::validate_and_create_from_json_path().
|
static |
Definition at line 266 of file db_json_path.cpp.
Referenced by db_json_path_is_token_valid_quoted_object_key(), db_json_path_quote_and_validate_unquoted_object_key(), and JSON_PATH::validate_and_create_from_json_path().