MySQL Connector/C++ 9.1.0
MySQL connector library for C and C++ applications
error.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, 2024, Oracle and/or its affiliates.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0, as
6 * published by the Free Software Foundation.
7 *
8 * This program is designed to work with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms, as
10 * designated in a particular file or component or in included license
11 * documentation. The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have either included with
14 * the program or referenced in the documentation.
15 *
16 * Without limiting anything contained in the foregoing, this file,
17 * which is part of Connector/C++, is also subject to the
18 * Universal FOSS Exception, version 1.0, a copy of which can be found at
19 * https://oss.oracle.com/licenses/universal-foss-exception.
20 *
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * See the GNU General Public License, version 2.0, for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#ifndef MYSQLX_DETAIL_ERROR_H
32#define MYSQLX_DETAIL_ERROR_H
33
39#include "../common.h"
40
41//#include <memory>
42
43
44namespace mysqlx {
45MYSQLX_ABI_BEGIN(2,0)
46
47namespace internal {
48
49class Result_detail;
50
51class Warning_detail
52 : public virtual common::Printable
53{
54protected:
55
56 byte m_level;
57 uint16_t m_code;
58 string m_msg;
59
60 Warning_detail(Warning_detail&&) = default;
61 Warning_detail(const Warning_detail&) = default;
62
63 Warning_detail(byte level, uint16_t code, const std::string &msg)
64 : m_level(level), m_code(code), m_msg(msg)
65 {}
66
67 void print(std::ostream &) const override;
68
69 friend Result_detail;
70};
71
72
73} // internal namespace
74MYSQLX_ABI_END(2,0)
75} // mysqlx
76
77#endif