/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-01-28 12:21:03 UTC
  • Revision ID: edam@waxworlds.org-20100128122103-v3gs6hro5h7ffnhb
- further initial development
- basic support for: queries, rows (query results)
- filename, comment header and project name consistency

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>
48
48
         * error message
49
49
         * @param error_code the sqlite error code
50
50
         */
51
 
        sqlite_error(
 
51
        explicit sqlite_error(
52
52
                int error_code );
53
53
 
54
54
        /**
57
57
         * @param message a customer error message string
58
58
         * @param error_code the sqlite error code
59
59
         */
60
 
        sqlite_error(
 
60
        explicit sqlite_error(
61
61
                const std::string &message,
62
62
                int error_code = SQLITE_ERROR );
63
63
 
100
100
};
101
101
 
102
102
 
103
 
}
104
 
 
105
 
 
106
 
#endif /* EXCEPTION_HPP_ */
 
103
/**
 
104
 * An sqlite error that indicates the database was busy
 
105
 */
 
106
class sqlite_busy
 
107
        :
 
108
        public sqlite_error
 
109
{
 
110
public:
 
111
        sqlite_busy()
 
112
                :
 
113
                sqlite_error( "database was busy", SQLITE_BUSY )
 
114
        { }
 
115
};
 
116
 
 
117
 
 
118
} // namespace sqlite
 
119
 
 
120
 
 
121
#endif /* SQLITE3CC_EXCEPTION_H_ */