MySQL 8.0.39
Source Code Documentation
json_error_handler.h
Go to the documentation of this file.
1#ifndef JSON_ERROR_HANDLER_INCLUDED
2#define JSON_ERROR_HANDLER_INCLUDED
3
4/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
26
27#include <cstdlib>
28#include <functional>
29
31 std::function<void(const char *parse_err, size_t err_offset)>;
32using JsonDocumentDepthHandler = std::function<void()>;
33
34#ifdef MYSQL_SERVER
35
37 public:
38 JsonParseDefaultErrorHandler(const char *func_name, int arg_idx)
39 : m_func_name(func_name), m_arg_idx(arg_idx) {}
40
41 void operator()(const char *parse_err, size_t err_offset) const;
42
43 private:
44 const char *m_func_name;
45 const int m_arg_idx;
46};
47
49
50#endif // MYSQL_SERVER
51#endif // JSON_ERROR_HANDLER_INCLUDED
Definition: json_error_handler.h:36
const int m_arg_idx
Definition: json_error_handler.h:45
JsonParseDefaultErrorHandler(const char *func_name, int arg_idx)
Definition: json_error_handler.h:38
void operator()(const char *parse_err, size_t err_offset) const
Definition: json_error_handler.cc:30
const char * m_func_name
Definition: json_error_handler.h:44
std::function< void()> JsonDocumentDepthHandler
Definition: json_error_handler.h:32
std::function< void(const char *parse_err, size_t err_offset)> JsonParseErrorHandler
Definition: json_error_handler.h:31
void JsonDocumentDefaultDepthHandler()
Definition: json_error_handler.cc:36