Kelsidavis-WoWee/tools/editor/cli_convert.hpp
Kelsi 98c7621e1d refactor(editor): extract batch convert handlers into cli_convert.cpp
Moves the four bulk format-conversion handlers out of main.cpp:
  --convert-m2-batch    (M2 → WOM)
  --convert-wmo-batch   (WMO → WOB)
  --convert-blp-batch   (BLP → PNG)
  --convert-dbc-batch   (DBC → JSON)

These all share the same pattern: walk srcDir recursively for
files of the input extension and fan out to the single-file
--convert-* counterpart via subprocess (preserving the existing
per-file logic as the source of truth, no duplication).

Single-file converters (--convert-m2, --convert-wmo, etc.) and
the --migrate-* meta-commands still live in main.cpp; they're
in dedicated argv-rescan loops that need a different extraction
approach.

main.cpp drops 18,396 → 18,198 lines (-198). Behavior verified
by re-running --convert-blp-batch with a missing directory and
confirming the same error message.
2026-05-09 02:25:05 -07:00

22 lines
608 B
C++

#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the batch format-conversion handlers:
// --convert-m2-batch (M2 → WOM)
// --convert-wmo-batch (WMO → WOB)
// --convert-blp-batch (BLP → PNG)
// --convert-dbc-batch (DBC → JSON)
//
// Each fans out to its single-file --convert-* counterpart via
// subprocess so the existing per-file logic stays the source of
// truth.
//
// Returns true if matched; outRc holds the exit code.
bool handleConvert(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee