blob: a4c51ce8ce4a6095e5dd5195e0b8074174a34e6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#include "GameBase.hpp"
#include "PGNGameBase.hpp"
std::shared_ptr<GameBase> OpenDatabase(const std::string &dbpath, bool createIfNotExist){
wxFileName file(dbpath);
wxString ext = file.GetExt().Lower();
bool create=(createIfNotExist && !file.Exists());
if (ext == "pgn") {
if(create)
PGNGameBase::CreateDatabaseFile(dbpath);
return std::shared_ptr<GameBase>(new PGNGameBase(dbpath));
}
return nullptr;
}
|