/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: 2010-07-27 15:12:55 UTC
  • Revision ID: edam@waxworlds.org-20100727151255-goaqgdz4kj13q7gz
- update TODO
- added some missing includes for <string>
- changed usage of database::exec() to not require return code!
- prevented transaction_guard destructor from throwing an exception

Show diffs side-by-side

added added

removed removed

32
32
{
33
33
 
34
34
 
35
 
class connection;
36
 
 
37
 
 
38
35
/**
39
36
 * Main (base) sqlite exception class.
40
37
 */
47
44
public:
48
45
 
49
46
        /**
50
 
         * Constructor that takes an sqlite result code and a connection from which
51
 
         * to determine it's error message
52
 
         * @param connection a reference to a connection
53
 
         * @param code the sqlite result code
54
 
         * @see sqlite_errmsg()
55
 
         */
56
 
        explicit sqlite_error(
57
 
                connection &connection,
58
 
                int code );
59
 
 
60
 
 
61
 
        /**
62
 
         * Constructor that takes an sqlite result code and determines it's own
63
 
         * generic error message
64
 
         * @param code the sqlite result code
65
 
         */
66
 
        explicit sqlite_error(
67
 
                int code );
68
 
 
69
 
        /**
70
 
         * Constructor that allows the creation of an sqlite result with a custom
 
47
         * Constructor that takes an sqlite error code and determines it's own
 
48
         * error message
 
49
         * @param code the sqlite error code
 
50
         */
 
51
        explicit sqlite_error(
 
52
                int code );
 
53
 
 
54
        /**
 
55
         * Constructor that allows the creation of an sqlite error with a custom
71
56
         * message.
72
57
         * @param message a customer error message string
73
 
         * @param code the sqlite result code
 
58
         * @param code the sqlite error code
74
59
         */
75
60
        explicit sqlite_error(
76
61
                const std::string &message,
83
68
public:
84
69
 
85
70
        /**
86
 
         * Get the sqlite result code associated with this error
87
 
         * @returns the sqlite result code
 
71
         * Get the sqlite error code associated with this error
 
72
         * @returns the sqlite error code
88
73
         */
89
74
        int get_code() const;
90
75
 
99
84
private:
100
85
 
101
86
        /**
102
 
         * Retrieve an automatic error message for a given sqlite result code
103
 
         * @param the sqlite result code
 
87
         * Retrieve an automatic error message for a given sqlite error code
 
88
         * @param the sqlite error code
104
89
         * @returns the automatic string
105
90
         */
106
91
        const std::string &get_message(
107
92
                int code );
108
93
 
109
 
        /** the result code */
 
94
        /** the error code */
110
95
        int _code;
111
96
 
112
97
        /** the message string */