refactor(editor): extract format validation into cli_format_validate.cpp

Moves the open-format validation + project-audit handlers out
of main.cpp:

  --validate                    --validate-wom
  --validate-wob                --validate-woc
  --validate-whm                --validate-all
  --validate-project            --validate-project-open-only
  --audit-project               --bench-audit-project
  --bench-validate-project

Also moves the four shared validate*Errors helpers (validateWom/
Wob/Woc/WhmErrors, ~365 lines) into the same module's anonymous
namespace — they were file-scope helpers in main.cpp used only
by these handlers, so co-locating eliminates the cross-TU
coupling.

main.cpp drops 19,446 → 18,396 lines (-1,050). Two build errors
caught during extraction (wrong include path for the WHM loader
header; missing #include for ContentPacker / std::set / std::map);
all fixed before commit.
This commit is contained in:
Kelsi 2026-05-09 01:57:37 -07:00
parent 2d81bc9f6b
commit b87ece2d5b
4 changed files with 1171 additions and 1054 deletions

View file

@ -1310,6 +1310,7 @@ add_executable(wowee_editor
tools/editor/cli_mesh_io.cpp
tools/editor/cli_mesh_edit.cpp
tools/editor/cli_wom_info.cpp
tools/editor/cli_format_validate.cpp
tools/editor/editor_app.cpp
tools/editor/editor_camera.cpp
tools/editor/editor_viewport.cpp

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,20 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the open-format validation + project audit handlers:
// --validate --validate-wom
// --validate-wob --validate-woc
// --validate-whm --validate-all
// --validate-project --validate-project-open-only
// --audit-project --bench-audit-project
// --bench-validate-project
//
// Returns true if matched; outRc holds the exit code.
bool handleFormatValidate(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee

File diff suppressed because it is too large Load diff