1
0
mirror of synced 2024-11-15 11:33:23 +01:00
ImHex/lib/libimhex/include/hex/helpers/fs.hpp

51 lines
1.0 KiB
C++

#pragma once
#include <hex.hpp>
#include <optional>
#include <string>
#include <vector>
#include <filesystem>
#include <functional>
#include <nfd.hpp>
#include <wolv/io/fs.hpp>
namespace hex::fs {
enum class DialogMode {
Open,
Save,
Folder
};
void setFileBrowserErrorCallback(const std::function<void()> &callback);
bool openFileBrowser(DialogMode mode, const std::vector<nfdfilteritem_t> &validExtensions, const std::function<void(std::fs::path)> &callback, const std::string &defaultPath = {}, bool multiple = false);
enum class ImHexPath : u32 {
Patterns = 0,
PatternsInclude,
Magic,
Plugins,
Yara,
Config,
Resources,
Constants,
Encodings,
Logs,
Recent,
Scripts,
Inspectors,
Themes,
Libraries,
Nodes,
END
};
bool isPathWritable(const std::fs::path &path);
std::vector<std::fs::path> getDefaultPaths(ImHexPath path, bool listNonExisting = false);
}