diff --git a/src/fc2dconfig.cpp b/src/fc2dconfig.cpp index f74f468..f4a6d60 100644 --- a/src/fc2dconfig.cpp +++ b/src/fc2dconfig.cpp @@ -30,6 +30,8 @@ wxIMPLEMENT_APP(ConfigurationApp); bool ConfigurationApp::OnInit() { initPrefixes(); + makePaths(); + // TODO: put config file creation here diff --git a/src/main.cpp b/src/main.cpp index 24579c0..71f12d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,7 @@ int main (int argc, char** argv) { std::cout << PROJECT_NAME " is starting..." << std::endl; initPrefixes(); + makePaths(); // load config file and apply it configFileOpen(&optData); diff --git a/src/paths.cpp b/src/paths.cpp index 6969309..f918821 100644 --- a/src/paths.cpp +++ b/src/paths.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #ifdef _WIN32 @@ -30,6 +31,13 @@ void initPrefixes() { #endif } +void makePaths() { + std::filesystem::create_directories(prefixConfig); + std::filesystem::create_directories(prefixCustom + "models/"); + std::filesystem::create_directories(prefixCustom + "cvdata/"); +} + + std::string resolvePath(const char* path) { std::string customString = prefixCustom + path; std::string defaultString = prefixDefault + path; diff --git a/src/paths.hpp b/src/paths.hpp index 71edec5..0b20ea1 100644 --- a/src/paths.hpp +++ b/src/paths.hpp @@ -9,6 +9,8 @@ extern std::string prefixDefault; void initPrefixes(); +void makePaths(); + std::string resolvePath(const char* path); #endif