The Battle for Wesnoth  1.15.3+dev
exceptions.hpp
Go to the documentation of this file.
1 //
2 // M A R I A D B + +
3 //
4 // Copyright Sylvain Rochette Langlois 2013,
5 // Frantisek Boranek 2015,
6 // The ViaDuck Project 2016 - 2018.
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 
11 #ifndef _MARIADB_EXCEPTIONS_HPP_
12 #define _MARIADB_EXCEPTIONS_HPP_
13 
14 #include <string>
15 #include <mariadb++/types.hpp>
16 
17 namespace mariadb {
18 namespace exception {
19 class base : public std::exception {
20  public:
21  //
22  // Constructor
23  //
24  base() throw() : std::exception(), m_error_id(0), m_error("Exception not defined") {}
25 
26  base(u32 error_id, const std::string& error) throw()
27  : std::exception(), m_error_id(error_id), m_error(error) {}
28 
29  base(const std::string& error) throw() : std::exception(), m_error_id(0), m_error(error) {}
30 
31  //
32  // Destructor
33  //
34  virtual ~base() throw() {}
35 
36  //
37  // Methods
38  //
39  virtual const char* what() const throw() { return m_error.c_str(); }
40 
41  u32 error_id() const throw() { return m_error_id; }
42 
43  protected:
46 };
47 
48 class date_time : public base {
49  public:
50  //
51  // Constructors
52  //
53  date_time(u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond) throw();
54 };
55 
56 class time : public base {
57  public:
58  //
59  // Constructors
60  //
61  time(u8 hour, u8 minute, u8 second, u16 millisecond) throw();
62 };
63 
64 class connection : public base {
65  public:
66  //
67  // Constructor
68  //
70 };
71 }
72 }
73 
74 #endif
static l_noret error(LoadState *S, const char *why)
Definition: lundump.cpp:39
STL namespace.
base(const std::string &error)
Definition: exceptions.hpp:29
connection(u32 error_id, const std::string &error)
Definition: exceptions.hpp:69
base(u32 error_id, const std::string &error)
Definition: exceptions.hpp:26
virtual const char * what() const
Definition: exceptions.hpp:39
unsigned char u8
Definition: types.hpp:20
if(m_stmt_data) return mariadb return date_time(std::string(m_row[index], column_size(index))).date()
unsigned short u16
Definition: types.hpp:21
unsigned int u32
Definition: types.hpp:22