mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 03:23:51 +00:00
feat(editor): add --catalog-stats for single-file deep size analysis
Reports header bytes (magic + version + nameLen + name + entryCount) vs entry-section bytes, average entry size, total file size, the catalog's name string length, and the first entry's id field. Useful for sizing analysis: "which catalogs are biggest, where do the bytes go, what's the per-entry overhead". Goes deeper than --info-magic which just reports the magic + version + name + count. The byte breakdown distinguishes: - headerBytes — fixed-cost header - catalogNameBytes — variable-length catalog label - entrySectionBytes — total size of all entries combined - averageEntryBytes — entrySectionBytes / entryCount Only the first entry's id is sampled because entries have variable-length name+description strings — multi-sampling produces garbage for most formats. The single sampled id is reliable because it sits at exactly headerBytes offset. JSON sidecar via --json. Format metadata (description / category) is included from the format table when the magic is recognized; unknown magics still get the size breakdown but no metadata. This is the 18th cross-format utility; the second per-file single-target one (alongside --info-magic). CLI flag count 1033 -> 1034.
This commit is contained in:
parent
6abd3f5398
commit
69857eea18
6 changed files with 199 additions and 0 deletions
|
|
@ -101,6 +101,7 @@
|
|||
#include "cli_diff_tree.hpp"
|
||||
#include "cli_orphan_jsons.hpp"
|
||||
#include "cli_list_by_magic.hpp"
|
||||
#include "cli_catalog_stats.hpp"
|
||||
#include "cli_macros_catalog.hpp"
|
||||
#include "cli_char_features_catalog.hpp"
|
||||
#include "cli_pvp_catalog.hpp"
|
||||
|
|
@ -273,6 +274,7 @@ constexpr DispatchFn kDispatchTable[] = {
|
|||
handleDiffTree,
|
||||
handleOrphanJsons,
|
||||
handleListByMagic,
|
||||
handleCatalogStats,
|
||||
handleMacrosCatalog,
|
||||
handleCharFeaturesCatalog,
|
||||
handlePVPCatalog,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue