mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 03:23:51 +00:00
feat(editor): add --summary-dir bulk content inventory
Recursively walks a directory, identifies every file by 4-byte
magic, and reports per-format file count, total entries, and
bytes. Useful for content audits ("how many cinematics did
this asset bundle ship?") and for tracking migration progress
("what fraction of zones still lack a holiday catalog?").
Also extracts the format-magic table out of cli_info_magic.cpp
into a shared cli_format_table.{hpp,cpp} so --info-magic and
--summary-dir reuse the same source of truth — adding a new
format now updates one row in one file instead of two. Both
flags use the standard catalog header (magic + version + name
+ entryCount) for catalog formats; asset/world formats are
counted but report 0 entries since their headers differ.
Supports --json variant for tooling integration.
This commit is contained in:
parent
c3121be011
commit
824a6c8cab
9 changed files with 316 additions and 73 deletions
37
tools/editor/cli_format_table.hpp
Normal file
37
tools/editor/cli_format_table.hpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Shared table of every novel open format the editor
|
||||
// recognizes — extracted so --info-magic and --summary-dir
|
||||
// can both look up files by their 4-byte magic without
|
||||
// drifting. Adding a new format requires appending one row
|
||||
// in cli_format_table.cpp.
|
||||
struct FormatMagicEntry {
|
||||
char magic[4]; // 4-char binary magic
|
||||
const char* extension; // file suffix (with dot)
|
||||
const char* category; // grouping label
|
||||
const char* infoFlag; // --info-* flag, nullptr if none
|
||||
const char* description;
|
||||
};
|
||||
|
||||
// Returns a pointer into the static table on match, nullptr
|
||||
// otherwise. The 4-byte magic argument does NOT need to be
|
||||
// null-terminated — only the first 4 bytes are inspected.
|
||||
const FormatMagicEntry* findFormatByMagic(const char magic[4]);
|
||||
|
||||
// Iterate the table — used by --summary-dir to pre-allocate
|
||||
// per-format counters keyed by index, and by tooling that
|
||||
// wants to enumerate the full set.
|
||||
const FormatMagicEntry* formatTableBegin();
|
||||
const FormatMagicEntry* formatTableEnd();
|
||||
size_t formatTableSize();
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue