/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:46:42 UTC
  • Revision ID: edam@waxworlds.org-20100727154642-1uxrjkpxhp7xl6hq
- moved null_t, exec_t and set_index_t to detail namespace so only their extern instantiations are in the main namespace
- added immediate transation

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * exception.hpp
 
2
 * exception.h
3
3
 *
4
4
 * Copyright (C) 2009 Tim Marston <edam@waxworlds.org>
5
5
 *
6
 
 * This file is part of sqlitepp (hereafter referred to as "this program").
7
 
 * See http://www.waxworlds.org/edam/software/sqlitepp for more information.
 
6
 * This file is part of sqlite3cc (hereafter referred to as "this program").
 
7
 * See http://www.waxworlds.org/edam/software/sqlite3cc for more information.
8
8
 *
9
9
 * This program is free software: you can redistribute it and/or modify
10
10
 * it under the terms of the GNU Lesser General Public License as published
20
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
21
 */
22
22
 
23
 
#ifndef EXCEPTION_HPP_
24
 
#define EXCEPTION_HPP_
 
23
#ifndef SQLITE3CC_EXCEPTION_H_
 
24
#define SQLITE3CC_EXCEPTION_H_
25
25
 
26
26
 
27
27
#include <sqlite3.h>
46
46
        /**
47
47
         * Constructor that takes an sqlite error code and determines it's own
48
48
         * error message
49
 
         * @param error_code the sqlite error code
 
49
         * @param code the sqlite error code
50
50
         */
51
 
        sqlite_error(
52
 
                int error_code );
 
51
        explicit sqlite_error(
 
52
                int code );
53
53
 
54
54
        /**
55
55
         * Constructor that allows the creation of an sqlite error with a custom
56
56
         * message.
57
57
         * @param message a customer error message string
58
 
         * @param error_code the sqlite error code
 
58
         * @param code the sqlite error code
59
59
         */
60
 
        sqlite_error(
 
60
        explicit sqlite_error(
61
61
                const std::string &message,
62
 
                int error_code = SQLITE_ERROR );
 
62
                int code = SQLITE_ERROR );
63
63
 
64
64
        virtual ~sqlite_error() throw( );
65
65
 
71
71
         * Get the sqlite error code associated with this error
72
72
         * @returns the sqlite error code
73
73
         */
74
 
        int get_error_code() const;
 
74
        int get_code() const;
75
75
 
76
76
        /**
77
77
         * Get the error message
88
88
         * @param the sqlite error code
89
89
         * @returns the automatic string
90
90
         */
91
 
        const std::string &get_error_message(
92
 
                int error_code );
 
91
        const std::string &get_message(
 
92
                int code );
93
93
 
94
94
        /** the error code */
95
 
        int _error_code;
 
95
        int _code;
96
96
 
97
97
        /** the message string */
98
98
        std::string _message;
100
100
};
101
101
 
102
102
 
103
 
}
104
 
 
105
 
 
106
 
#endif /* EXCEPTION_HPP_ */
 
103
} // namespace sqlite
 
104
 
 
105
 
 
106
#endif /* SQLITE3CC_EXCEPTION_H_ */