aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/gamebase/GameBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_tab/gamebase/GameBase.cpp')
-rw-r--r--src/base_tab/gamebase/GameBase.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/base_tab/gamebase/GameBase.cpp b/src/base_tab/gamebase/GameBase.cpp
new file mode 100644
index 0000000..e8f9a59
--- /dev/null
+++ b/src/base_tab/gamebase/GameBase.cpp
@@ -0,0 +1,13 @@
+#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();
+ if (ext == "pgn") {
+ if(createIfNotExist && !file.Exists())
+ PGNGameBase::CreateDatabaseFile(dbpath);
+ return std::shared_ptr<GameBase>(new PGNGameBase(dbpath));
+ }
+ return nullptr;
+} \ No newline at end of file