Feature/filesystem cleanup (#1587)

* Adapting to the changes in Ghoul
* First step of moving filesystem functions to std
* Remove persistence flag from cachemanager
This commit is contained in:
Alexander Bock
2021-05-16 20:26:49 +02:00
committed by GitHub
parent 2ca7101b6c
commit ccdc5a5dc3
87 changed files with 648 additions and 711 deletions

View File

@@ -38,6 +38,7 @@
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/misc/dictionary.h>
#include <ghoul/ghoul.h>
#include <filesystem>
#include <iostream>
int main(int argc, char** argv) {
@@ -54,17 +55,20 @@ int main(int argc, char** argv) {
// to make it possible to find other files in the same directory.
FileSys.registerPathToken(
"${BIN}",
ghoul::filesystem::File(absPath(argv[0])).directoryName(),
std::filesystem::path(argv[0]).parent_path(),
ghoul::filesystem::FileSystem::Override::Yes
);
std::string configFile = configuration::findConfiguration();
std::filesystem::path configFile = configuration::findConfiguration();
// Register the base path as the directory where 'filename' lives
std::string base = ghoul::filesystem::File(configFile).directoryName();
std::filesystem::path base = configFile.parent_path();
constexpr const char* BasePathToken = "${BASE}";
FileSys.registerPathToken(BasePathToken, base);
*global::configuration = configuration::loadConfigurationFromFile(configFile, "");
*global::configuration = configuration::loadConfigurationFromFile(
configFile.string(),
""
);
global::openSpaceEngine->registerPathTokens();
global::openSpaceEngine->initialize();