Flutter Impeller
impeller::ArchiveDatabase::Handle Struct Reference

Public Member Functions

 Handle (const std::string &filename)
 
 ~Handle ()
 
::sqlite3 * Get () const
 
bool IsValid () const
 

Detailed Description

Definition at line 19 of file archive_database.cc.

Constructor & Destructor Documentation

◆ Handle()

impeller::ArchiveDatabase::Handle::Handle ( const std::string &  filename)
inlineexplicit

Definition at line 20 of file archive_database.cc.

20  {
21  if (::sqlite3_initialize() != SQLITE_OK) {
22  VALIDATION_LOG << "Could not initialize sqlite.";
23  return;
24  }
25 
26  sqlite3* db = nullptr;
27  auto res = ::sqlite3_open(filename.c_str(), &db);
28 
29  if (res != SQLITE_OK || db == nullptr) {
30  return;
31  }
32 
33  handle_ = db;
34  }

References VALIDATION_LOG.

◆ ~Handle()

impeller::ArchiveDatabase::Handle::~Handle ( )
inline

Definition at line 36 of file archive_database.cc.

36  {
37  if (handle_ == nullptr) {
38  return;
39  }
40  ::sqlite3_close(handle_);
41  }

Member Function Documentation

◆ Get()

::sqlite3* impeller::ArchiveDatabase::Handle::Get ( ) const
inline

Definition at line 43 of file archive_database.cc.

43 { return handle_; }

◆ IsValid()

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

Definition at line 45 of file archive_database.cc.

45 { return handle_ != nullptr; }

The documentation for this struct was generated from the following file:
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:60