mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
tools: Added file shredder, splitter and combiner
This commit is contained in:
@@ -30,9 +30,10 @@ namespace hex {
|
||||
|
||||
~File();
|
||||
|
||||
bool isValid() const { return this->m_file != nullptr; }
|
||||
[[nodiscard]] bool isValid() const { return this->m_file != nullptr; }
|
||||
|
||||
void seek(u64 offset);
|
||||
void close();
|
||||
|
||||
size_t readBuffer(u8 *buffer, size_t size);
|
||||
std::vector<u8> readBytes(size_t numBytes = 0);
|
||||
@@ -42,13 +43,18 @@ namespace hex {
|
||||
void write(const std::vector<u8> &bytes);
|
||||
void write(const std::string &string);
|
||||
|
||||
size_t getSize() const;
|
||||
[[nodiscard]] size_t getSize() const;
|
||||
void setSize(u64 size);
|
||||
|
||||
void flush();
|
||||
void remove();
|
||||
|
||||
auto getHandle() { return this->m_file; }
|
||||
const std::string& getPath() { return this->m_path; }
|
||||
|
||||
private:
|
||||
FILE *m_file;
|
||||
std::string m_path;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -8,12 +8,12 @@ namespace hex::literals {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
constexpr static inline unsigned long long operator ""_kiB(unsigned long long kiB) noexcept {
|
||||
constexpr static inline unsigned long long operator ""_KiB(unsigned long long kiB) noexcept {
|
||||
return operator ""_Bytes(kiB * 1024);
|
||||
}
|
||||
|
||||
constexpr static inline unsigned long long operator ""_MiB(unsigned long long MiB) noexcept {
|
||||
return operator ""_kiB(MiB * 1024);
|
||||
return operator ""_KiB(MiB * 1024);
|
||||
}
|
||||
|
||||
constexpr static inline unsigned long long operator ""_GiB(unsigned long long GiB) noexcept {
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace hex {
|
||||
static std::vector<ContentRegistry::Tools::Entry> toolsEntries;
|
||||
static std::vector<ContentRegistry::DataInspector::Entry> dataInspectorEntries;
|
||||
static u32 patternPaletteOffset;
|
||||
static std::string errorPopupMessage;
|
||||
static std::string popupMessage;
|
||||
static std::list<ImHexApi::Bookmarks::Entry> bookmarkEntries;
|
||||
static std::vector<pl::PatternData*> patternData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user