4 #ifndef SQLITEPP_SQLITEPP_H_ 5 #define SQLITEPP_SQLITEPP_H_ 151 Openable(
const bool open,
const std::string& name);
161 void requireOpen()
const;
167 void setOpen(
const bool open);
171 const std::string& m_name;
200 DatabaseError(
const int errorCode,
const std::string& errorMessage);
205 int errorCode()
const;
208 const int m_errorCode;
210 static std::string getErrorMessage(
const int errorCode,
211 const std::string& errorMessage);
241 void bind(
const int index,
const double value);
252 void bind(
const std::string& name,
const double value);
263 void bind(
const int index,
const int value);
274 void bind(
const std::string& name,
const int value);
285 void bind(
const int index,
const std::string& value);
296 void bind(
const std::string& name,
const std::string& value);
323 explicit Statement(sqlite3_stmt* handle);
325 int getParameterIndex(
const std::string& name)
const;
326 void handleBindResult(
const int index,
const int result)
const;
327 void requireCanRead()
const;
328 void setInstancePointer(
const std::weak_ptr<Statement>& instancePointer);
331 sqlite3_stmt* m_handle;
333 std::weak_ptr<Statement> m_instancePointer;
371 explicit Database(
const std::string& file);
392 void execute(
const std::string& sql);
403 int lastInsertRowId()
const;
416 void open(
const std::string& file);
428 std::shared_ptr<Statement> prepare(
const std::string& sql);
443 bool canRead()
const;
452 int columnCount()
const;
472 double readDouble(
const int column)
const;
483 int readInt(
const int column)
const;
494 std::string readString(
const int column)
const;
497 explicit ResultSet(
const std::shared_ptr<Statement> statement);
499 const std::shared_ptr<Statement> m_statement;
506 #endif // SQLITEPP_SQLITEPP_H_ A result set returned from a SQL query.
Definition: sqlitepp.h:438
A handle for a SQLite3 statement.
Definition: sqlitepp.h:224
A class that forbids copying and assignments for all subclasses.
Definition: sqlitepp.h:116
An error that occurred during a database operation.
Definition: sqlitepp.h:184
Contains all classes of the sqlitepp library.
Definition: sqlitepp.cpp:10
A handle for a SQLite3 database.
Definition: sqlitepp.h:350
An element that has the two states open and closed.
Definition: sqlitepp.h:138