/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/command.h

  • Committer: edam
  • Date: 2010-07-29 06:39:13 UTC
  • Revision ID: edam@waxworlds.org-20100729063913-wvcvkogsa2alwkhr
- moved basic_statement::operator <<() back to basic_statement and just create another specialisation in command so that it can use sqlite::exec

Show diffs side-by-side

added added

removed removed

126
126
                return _last_insert_rowid;
127
127
        }
128
128
 
129
 
        /**
130
 
         * Stream operator is used to bind values to parameters automatically, in
131
 
         * ascending order. In addition, the null, set_index() and execute auto-
132
 
         * binding manipulators can be used.
133
 
         * @param value a value to bind
134
 
         */
135
 
        template< class T >
136
 
        command &operator <<(
137
 
                const T &value )
138
 
        {
139
 
                int code = bind( _bind_index, value );
140
 
                if( code != SQLITE_OK ) throw sqlite_error( _database, code );
141
 
                _bind_index++;
142
 
                return *this;
143
 
        }
144
 
 
145
129
//______________________________________________________________________________
146
130
//                                                                implementation
147
131
private:
158
142
};
159
143
 
160
144
 
161
 
// template specialisations for command::operator <<()
162
 
template< >
163
 
command &command::operator << < detail::null_t >(
164
 
        const detail::null_t & );
165
 
template< >
166
 
command &command::operator << < detail::exec_t >(
 
145
// template specialisations for basic_statement::operator <<()
 
146
template< >
 
147
basic_statement &basic_statement::operator << < detail::exec_t >(
167
148
        const detail::exec_t & );
168
 
template< >
169
 
command &command::operator << < detail::set_index_t >(
170
 
        const detail::set_index_t &t );
171
149
 
172
150
 
173
151
} // namespace sqlite