37 lines
578 B
C++
37 lines
578 B
C++
|
#include "DatabaseManager.h"
|
||
|
|
||
|
DatabaseManager::DatabaseManager()
|
||
|
: mDatabase(),
|
||
|
mDatabaseInterface()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
DatabaseManager::~DatabaseManager()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
std::shared_ptr<DatabaseManager> DatabaseManager::Create()
|
||
|
{
|
||
|
return std::make_shared<DatabaseManager>();
|
||
|
}
|
||
|
|
||
|
|
||
|
void DatabaseManager::CreateDatabase(const std::string& path)
|
||
|
{
|
||
|
mDatabase = Database::Create();
|
||
|
mDatabase->SetPath(path);
|
||
|
|
||
|
mDatabaseInterface = SqliteInterface::Create();
|
||
|
mDatabaseInterface->Open(mDatabase);
|
||
|
}
|
||
|
|
||
|
void DatabaseManager::OnShutDown()
|
||
|
{
|
||
|
if(mDatabaseInterface)
|
||
|
{
|
||
|
mDatabaseInterface->Close();
|
||
|
}
|
||
|
}
|