/sqlite3cc

To get this branch, use:
bzr branch http://bzr.ed.am/sqlite3cc

« back to all changes in this revision

Viewing changes to include/sqlite3cc/exception.h

  • Committer: edam
  • Date: 2012-01-23 13:46:27 UTC
  • Revision ID: edam@waxworlds.org-20120123134627-i6hi9aftfvwgp8vw
updated autotols stuff

Show diffs side-by-side

added added

removed removed

1
1
/*
2
2
 * exception.h
3
3
 *
4
 
 * Copyright (C) 2009 Tim Marston <tim@ed.am>
 
4
 * Copyright (C) 2009 Tim Marston <edam@waxworlds.org>
5
5
 *
6
6
 * This file is part of sqlite3cc (hereafter referred to as "this program").
7
 
 * See http://ed.am/dev/sqlite3cc for more information.
8
 
 *
9
 
 * This program is free software: you can redistribute it and/or modify it under
10
 
 * the terms of the GNU Lesser General Public License as published by the Free
11
 
 * Software Foundation, either version 3 of the License, or (at your option) any
12
 
 * later version.
13
 
 *
14
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
15
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
 
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
17
 
 * details.
 
7
 * See http://www.waxworlds.org/edam/software/sqlite3cc for more information.
 
8
 *
 
9
 * This program is free software: you can redistribute it and/or modify
 
10
 * it under the terms of the GNU Lesser General Public License as published
 
11
 * by the Free Software Foundation, either version 3 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU Lesser General Public License for more details.
18
18
 *
19
19
 * You should have received a copy of the GNU Lesser General Public License
20
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26
26
 
27
27
#include <sqlite3.h>
28
28
#include <stdexcept>
29
 
#include <string>
30
29
 
31
30
 
32
31
namespace sqlite
49
48
 
50
49
        /**
51
50
         * Constructor that takes an sqlite result code and a connection from which
52
 
         * to determine it's error message.
53
 
         *
 
51
         * to determine it's error message
54
52
         * @param connection a reference to a connection
55
53
         * @param code the sqlite result code
56
54
         * @see sqlite_errmsg()
62
60
 
63
61
        /**
64
62
         * Constructor that takes an sqlite result code and determines it's own
65
 
         * generic error message.
66
 
         *
 
63
         * generic error message
67
64
         * @param code the sqlite result code
68
65
         */
69
66
        explicit sqlite_error(
72
69
        /**
73
70
         * Constructor that allows the creation of an sqlite result with a custom
74
71
         * message.
75
 
         *
76
72
         * @param message a customer error message string
77
73
         * @param code the sqlite result code
78
74
         */
87
83
public:
88
84
 
89
85
        /**
90
 
         * Get the sqlite result code associated with this error.
91
 
         *
 
86
         * Get the sqlite result code associated with this error
92
87
         * @returns the sqlite result code
93
88
         */
94
89
        int get_code() const;
104
99
private:
105
100
 
106
101
        /**
107
 
         * Retrieve an automatic error message for a given sqlite result code.
108
 
         *
 
102
         * Retrieve an automatic error message for a given sqlite result code
109
103
         * @param the sqlite result code
110
104
         * @returns the automatic string
111
105
         */