sqlitexx: except.hpp Source File

sqlitexx 0.0.1

except.hpp
Go to the documentation of this file.
1/*
2 * sqlite3xx - sqlite3 C++ layer, following the ideas of libpqxx
3 * Copyright (C) 2009 Andreas Baumann
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions of
7 * the GNU Lesser General Public License, as published by the Free Software
8 * Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 * License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this distribution; if not, write to:
18 * Free Software Foundation, Inc.
19 * 51 Franklin Street, Fifth Floor
20 * Boston, MA 02110-1301 USA
21 *
22 */
23
24#ifndef SQLITE3XX_EXCEPT_H
25#define SQLITE3XX_EXCEPT_H
26
27#include <stdexcept>
28
29#include "port/dllexport.h"
30
31using namespace std;
32
33namespace sqlite3xx {
34
35 class SQLITEXX_LIBEXPORT sqlitexx_exception {
36 public:
37 virtual ~sqlitexx_exception( ) throw( ) = 0;
38
39 virtual exception &base( ) throw( ) = 0;
40};
41
42class SQLITEXX_LIBEXPORT failure : public sqlitexx_exception, public runtime_error
43{
44 virtual exception &base( ) throw( ) { return *this; }
45
46 public:
47 explicit failure( const string &m );
48};
49
50 class SQLITEXX_LIBEXPORT sql_error : public failure
51{
52 string m_q;
53
54 public:
55 sql_error( );
56 explicit sql_error( const string& _q );
57 explicit sql_error( const string& _what, const string& _q );
58 virtual ~sql_error( ) throw( );
59
60 const string& msg( ) const throw( );
61 const string& query( ) const throw( );
62};
63
64class SQLITEXX_LIBEXPORT database_locked : public failure
65{
66 public:
67 database_locked( );
68 explicit database_locked( const string &_what );
69};
70
71} // namespace sqlite3xx
72
73#endif /* SQLITE3XX_EXCEPT_H */
sqlite3xx::database_locked
Definition except.hpp:65
sqlite3xx::database_locked::database_locked
database_locked()
sqlite3xx::database_locked::database_locked
database_locked(const string &_what)
sqlite3xx::failure
Definition except.hpp:43
sqlite3xx::failure::failure
failure(const string &m)
sqlite3xx::sql_error
Definition except.hpp:51
sqlite3xx::sql_error::~sql_error
virtual ~sql_error()
sqlite3xx::sql_error::sql_error
sql_error(const string &_what, const string &_q)
sqlite3xx::sql_error::sql_error
sql_error()
sqlite3xx::sql_error::sql_error
sql_error(const string &_q)
sqlite3xx::sqlitexx_exception
Definition except.hpp:35
sqlite3xx::sqlitexx_exception::~sqlitexx_exception
virtual ~sqlitexx_exception()=0
dllexport.h
SQLITEXX_LIBEXPORT
#define SQLITEXX_LIBEXPORT
Definition dllexport.h:35
sqlite3xx
Definition connection.hpp:41