sys: Replaced many helper functions with libwolv

This commit is contained in:
WerWolv
2023-03-12 18:27:29 +01:00
parent e958934a22
commit 0dafb3d230
62 changed files with 263 additions and 1091 deletions

View File

@@ -3,6 +3,8 @@
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fs.hpp>
#include <wolv/utils/guards.hpp>
#include <hex/providers/provider.hpp>
#include <filesystem>
@@ -27,7 +29,7 @@ namespace hex::magic {
for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Magic)) {
for (const auto &entry : std::fs::directory_iterator(dir, error)) {
if (entry.is_regular_file() && ((sourceFiles && entry.path().extension().empty()) || (!sourceFiles && entry.path().extension() == ".mgc"))) {
magicFiles += hex::toUTF8String(fs::toShortPath(entry.path())) + MAGIC_PATH_SEPARATOR;
magicFiles += hex::toUTF8String(wolv::io::fs::toShortPath(entry.path())) + MAGIC_PATH_SEPARATOR;
}
}
}