mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
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:
@@ -29,8 +29,8 @@
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/filesystem/directory.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
namespace {
|
||||
@@ -67,10 +67,9 @@ InstrumentTimesParser::InstrumentTimesParser(std::string name, std::string seque
|
||||
}
|
||||
|
||||
bool InstrumentTimesParser::create() {
|
||||
using RawPath = ghoul::filesystem::Directory::RawPath;
|
||||
ghoul::filesystem::Directory sequenceDir(_fileName, RawPath::Yes);
|
||||
if (!FileSys.directoryExists(sequenceDir)) {
|
||||
LERROR(fmt::format("Could not load Label Directory '{}'", sequenceDir.path()));
|
||||
std::string sequenceDir = absPath(_fileName);
|
||||
if (!std::filesystem::is_directory(sequenceDir)) {
|
||||
LERROR(fmt::format("Could not load Label Directory '{}'", sequenceDir));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -79,12 +78,9 @@ bool InstrumentTimesParser::create() {
|
||||
for (const std::pair<const K, V>& p : _instrumentFiles) {
|
||||
const std::string& instrumentID = p.first;
|
||||
for (std::string filename : p.second) {
|
||||
std::string filepath = FileSys.pathByAppendingComponent(
|
||||
sequenceDir.path(),
|
||||
std::move(filename)
|
||||
);
|
||||
std::string filepath = fmt::format("{}/{}", sequenceDir, std::move(filename));
|
||||
|
||||
if (!FileSys.fileExists(filepath)) {
|
||||
if (!std::filesystem::is_regular_file(filepath)) {
|
||||
LERROR(fmt::format("Unable to read file '{}'. Skipping file", filepath));
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user