diff options
author | Aki <please@ignore.pl> | 2022-08-20 23:04:27 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-08-20 23:04:27 +0200 |
commit | ac8732867f57f59b8f4aec8d28b8e745046c9ac7 (patch) | |
tree | 68cfa9093dbbb31dc4af3cffd33eb5d0cd178079 /ArchiveEx/Archive.h | |
parent | bc9502fbc36946f1d96d3f188e18346baddbf1d5 (diff) | |
download | starshatter-ac8732867f57f59b8f4aec8d28b8e745046c9ac7.zip starshatter-ac8732867f57f59b8f4aec8d28b8e745046c9ac7.tar.gz starshatter-ac8732867f57f59b8f4aec8d28b8e745046c9ac7.tar.bz2 |
Added options to inspect archive content in dat utility
Old PrintX methods were replaced by higher order functions ForEachX that are
intended to give slighly more granual control and move the responsibility of
what actually happens to the user without introducing a whole iterator.
Diffstat (limited to 'ArchiveEx/Archive.h')
-rw-r--r-- | ArchiveEx/Archive.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ArchiveEx/Archive.h b/ArchiveEx/Archive.h index 7ba32e4..9526ff0 100644 --- a/ArchiveEx/Archive.h +++ b/ArchiveEx/Archive.h @@ -2,6 +2,7 @@ #include <cstddef> #include <cstdint> +#include <functional> #include <vector> @@ -32,8 +33,8 @@ public: void WriteMeta(bool create=false); void GenerateBlockMap(); std::size_t FindFreeSpot(std::size_t bytes) const; - void PrintNamesOfEntries() const; - void PrintBlocks() const; + void ForEachEntry(std::function<void(const char*)> func) const; + void ForEachBlock(std::function<void(const char*)> func) const; std::size_t DirectoryBlocks() const; private: const char* path; |