OSDN Git Service

大量変更… (こういう風に書くのは好ましくない〜)
[gikomona/GikoMona.git] / core / src / GikoMona.cpp
index 9b0b5c2..74d450c 100644 (file)
@@ -1,4 +1,8 @@
 #include <wx/xrc/xmlres.h>
+#include <exception>
+
+#include <boost/filesystem.hpp>
+
 #include <wx/msgdlg.h>
 
 #include "GikoMona.hpp"
@@ -20,8 +24,16 @@ bool init_core() {
     wxXmlResource::Get()->InitAllHandlers();
     wxXmlResource::Get()->LoadAllFiles(wxT("resouce"));
     
+    boost::system::error_code reason;
+    if(!boost::filesystem::create_directory(".tmp", reason) || reason) {
+        // log
+        std::terminate();
+    }
+    
     app_model = new model;
     app_extension = new extension;
+    
+    return true;
 }
 
 void done_core() noexcept {
@@ -33,6 +45,11 @@ void done_core() noexcept {
 
 void optimize_database(const boost::filesystem::path& db_path) {
     database db(db_path);
+    /*
+    auto value = db.compile(u8"SELECT * FROM file-information;");
+    value.execute();
+    value.get_result<int>();
+    */
     if(db.select<int>("count-of-deleting-values", "file-infomation") >= 1000) {
         db.optimize();
     }