@@ -171,91 +171,67 @@ void Statement::bind(const int aIndex)
171
171
// Bind an int value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
172
172
void Statement::bind (const char * apName, const int aValue)
173
173
{
174
- const int index = getIndex (apName);
175
- const int ret = sqlite3_bind_int (mStmtPtr , index, aValue);
176
- check (ret);
174
+ bind (getIndex (apName), aValue);
177
175
}
178
176
179
177
// Bind a 32bits unsigned int value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
180
178
void Statement::bind (const char * apName, const unsigned aValue)
181
179
{
182
- const int index = getIndex (apName);
183
- const int ret = sqlite3_bind_int64 (mStmtPtr , index, aValue);
184
- check (ret);
180
+ bind (getIndex (apName), aValue);
185
181
}
186
182
187
183
// Bind a 64bits int value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
188
184
void Statement::bind (const char * apName, const long long aValue)
189
185
{
190
- const int index = getIndex (apName);
191
- const int ret = sqlite3_bind_int64 (mStmtPtr , index, aValue);
192
- check (ret);
186
+ bind (getIndex (apName), aValue);
193
187
}
194
188
195
189
// Bind a double (64bits float) value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
196
190
void Statement::bind (const char * apName, const double aValue)
197
191
{
198
- const int index = getIndex (apName);
199
- const int ret = sqlite3_bind_double (mStmtPtr , index, aValue);
200
- check (ret);
192
+ bind (getIndex (apName), aValue);
201
193
}
202
194
203
195
// Bind a string value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
204
196
void Statement::bind (const char * apName, const std::string& aValue)
205
197
{
206
- const int index = getIndex (apName);
207
- const int ret = sqlite3_bind_text (mStmtPtr , index, aValue.c_str (),
208
- static_cast <int >(aValue.size ()), SQLITE_TRANSIENT);
209
- check (ret);
198
+ bind (getIndex (apName), aValue);
210
199
}
211
200
212
201
// Bind a text value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
213
202
void Statement::bind (const char * apName, const char * apValue)
214
203
{
215
- const int index = getIndex (apName);
216
- const int ret = sqlite3_bind_text (mStmtPtr , index, apValue, -1 , SQLITE_TRANSIENT);
217
- check (ret);
204
+ bind (getIndex (apName), apValue);
218
205
}
219
206
220
207
// Bind a binary blob value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
221
208
void Statement::bind (const char * apName, const void * apValue, const int aSize)
222
209
{
223
- const int index = getIndex (apName);
224
- const int ret = sqlite3_bind_blob (mStmtPtr , index, apValue, aSize, SQLITE_TRANSIENT);
225
- check (ret);
210
+ bind (getIndex (apName), apValue, aSize);
226
211
}
227
212
228
213
// Bind a string value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
229
214
void Statement::bindNoCopy (const char * apName, const std::string& aValue)
230
215
{
231
- const int index = getIndex (apName);
232
- const int ret = sqlite3_bind_text (mStmtPtr , index, aValue.c_str (),
233
- static_cast <int >(aValue.size ()), SQLITE_STATIC);
234
- check (ret);
216
+ bindNoCopy (getIndex (apName), aValue);
235
217
}
236
218
237
219
// Bind a text value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
238
220
void Statement::bindNoCopy (const char * apName, const char * apValue)
239
221
{
240
- const int index = getIndex (apName);
241
- const int ret = sqlite3_bind_text (mStmtPtr , index, apValue, -1 , SQLITE_STATIC);
242
- check (ret);
222
+ bindNoCopy (getIndex (apName), apValue);
243
223
}
244
224
245
225
// Bind a binary blob value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
246
226
void Statement::bindNoCopy (const char * apName, const void * apValue, const int aSize)
247
227
{
248
- const int index = getIndex (apName);
249
- const int ret = sqlite3_bind_blob (mStmtPtr , index, apValue, aSize, SQLITE_STATIC);
250
- check (ret);
228
+ bindNoCopy (getIndex (apName), apValue, aSize);
251
229
}
252
230
253
231
// Bind a NULL value to a parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement
254
232
void Statement::bind (const char * apName)
255
233
{
256
- const int index = getIndex (apName);
257
- const int ret = sqlite3_bind_null (mStmtPtr , index);
258
- check (ret);
234
+ bind (getIndex (apName));
259
235
}
260
236
261
237
0 commit comments