Flutter Impeller
impeller::ArchiveStatement::Handle Struct Reference

Public Member Functions

 Handle (void *db, const std::string &statememt)
 
 ~Handle ()
 
bool IsValid () const
 
::sqlite3_stmt * Get () const
 

Detailed Description

Definition at line 14 of file archive_statement.cc.

Constructor & Destructor Documentation

◆ Handle()

impeller::ArchiveStatement::Handle::Handle ( void *  db,
const std::string &  statememt 
)
inline

Definition at line 15 of file archive_statement.cc.

15  {
16  if (db == nullptr) {
17  return;
18  }
19  ::sqlite3_stmt* handle = nullptr;
20  if (::sqlite3_prepare_v2(reinterpret_cast<sqlite3*>(db), //
21  statememt.c_str(), //
22  static_cast<int>(statememt.size()), //
23  &handle, //
24  nullptr) == SQLITE_OK) {
25  handle_ = handle;
26  }
27  }

◆ ~Handle()

impeller::ArchiveStatement::Handle::~Handle ( )
inline

Definition at line 29 of file archive_statement.cc.

29  {
30  if (handle_ == nullptr) {
31  return;
32  }
33  auto res = ::sqlite3_finalize(handle_);
34  FML_CHECK(res == SQLITE_OK) << "Unable to finalize the archive.";
35  }

Member Function Documentation

◆ Get()

::sqlite3_stmt* impeller::ArchiveStatement::Handle::Get ( ) const
inline

Definition at line 39 of file archive_statement.cc.

39 { return handle_; }

◆ IsValid()

bool impeller::ArchiveStatement::Handle::IsValid ( ) const
inline

Definition at line 37 of file archive_statement.cc.

37 { return handle_ != nullptr; }

The documentation for this struct was generated from the following file: