/sqlite3cc

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

« back to all changes in this revision

Viewing changes to src/exception.cc

  • Committer: edam
  • Date: 2010-07-23 09:17:03 UTC
  • Revision ID: edam@waxworlds.org-20100723091703-3siqjj6eeux9hupz
- added NEWS
- added library checks to configure.ac
- added query::iterators
- remove dependency that rows have on querys (since querys have to be dependent on rows for boost::iterator_facade to work)
- rows now have the handle to the sqlite3 statement and know a count of their row number
- added convenience function tht can be used to detect presence of sqlite3cc in other packages
- updated test-main
- renamed all subdir.mk files to emake.mk

Show diffs side-by-side

added added

removed removed

27
27
 
28
28
 
29
29
sqlite::sqlite_error::sqlite_error(
30
 
        int error_code )
 
30
        int code )
31
31
        :
32
 
        _error_code( error_code ),
33
 
        _message( get_error_message( error_code ) )
 
32
        _code( code ),
 
33
        _message( get_message( code ) )
34
34
{
35
35
}
36
36
 
37
37
 
38
38
sqlite::sqlite_error::sqlite_error(
39
39
        const std::string &message,
40
 
        int error_code )
 
40
        int code )
41
41
        :
42
 
        _error_code( error_code ),
 
42
        _code( code ),
43
43
        _message( message )
44
44
{
45
45
}
50
50
}
51
51
 
52
52
 
53
 
int sqlite::sqlite_error::get_error_code() const
 
53
int sqlite::sqlite_error::get_code() const
54
54
{
55
 
        return _error_code;
 
55
        return _code;
56
56
}
57
57
 
58
58
 
62
62
}
63
63
 
64
64
 
65
 
const std::string &sqlite::sqlite_error::get_error_message(
66
 
        int error_code )
 
65
const std::string &sqlite::sqlite_error::get_message(
 
66
        int code )
67
67
{
68
68
        static const std::map< int, std::string > messages =
69
69
                boost::assign::map_list_of
98
98
                ( SQLITE_DONE, "sqlite3_step() has finished executing" );
99
99
 
100
100
        std::map< int, std::string >::const_iterator i =
101
 
                messages.find( error_code );
 
101
                messages.find( code );
102
102
        if( i == messages.end() )
103
103
                throw std::range_error( "bad sqlite error code" );
104
104
        return i->second;