| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/sqlite_utils.h" | 5 #include "chrome/common/sqlite_utils.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 int SQLStatement::reset() { | 214 int SQLStatement::reset() { |
| 215 DCHECK(stmt_); | 215 DCHECK(stmt_); |
| 216 return sqlite3_reset(stmt_); | 216 return sqlite3_reset(stmt_); |
| 217 } | 217 } |
| 218 | 218 |
| 219 sqlite_int64 SQLStatement::last_insert_rowid() { | 219 sqlite_int64 SQLStatement::last_insert_rowid() { |
| 220 DCHECK(stmt_); | 220 DCHECK(stmt_); |
| 221 return sqlite3_last_insert_rowid(db_handle()); | 221 return sqlite3_last_insert_rowid(db_handle()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 int SQLStatement::changes() { |
| 225 DCHECK(stmt_); |
| 226 return sqlite3_changes(db_handle()); |
| 227 } |
| 228 |
| 224 sqlite3* SQLStatement::db_handle() { | 229 sqlite3* SQLStatement::db_handle() { |
| 225 DCHECK(stmt_); | 230 DCHECK(stmt_); |
| 226 return sqlite3_db_handle(stmt_); | 231 return sqlite3_db_handle(stmt_); |
| 227 } | 232 } |
| 228 | 233 |
| 229 int SQLStatement::bind_parameter_count() { | 234 int SQLStatement::bind_parameter_count() { |
| 230 DCHECK(stmt_); | 235 DCHECK(stmt_); |
| 231 return sqlite3_bind_parameter_count(stmt_); | 236 return sqlite3_bind_parameter_count(stmt_); |
| 232 } | 237 } |
| 233 | 238 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 const char* s = column_text(index); | 400 const char* s = column_text(index); |
| 396 str->assign(s ? UTF8ToWide(s) : std::wstring()); | 401 str->assign(s ? UTF8ToWide(s) : std::wstring()); |
| 397 return (s != NULL); | 402 return (s != NULL); |
| 398 } | 403 } |
| 399 | 404 |
| 400 std::wstring SQLStatement::column_wstring(int index) { | 405 std::wstring SQLStatement::column_wstring(int index) { |
| 401 std::wstring wstr; | 406 std::wstring wstr; |
| 402 column_wstring(index, &wstr); | 407 column_wstring(index, &wstr); |
| 403 return wstr; | 408 return wstr; |
| 404 } | 409 } |
| OLD | NEW |