#include "GameBase.hpp" #include "PGNGameBase.hpp" std::shared_ptr 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(new PGNGameBase(dbpath)); } return nullptr; }