feat(editor): add WWFL JSON round-trip (--export/--import-wwfl-json)

Dual encoding for both WWFL enums via the readEnumField
template: filterKind (int 0..5 OR 255 OR token "spam"/
"goldseller"/"allcaps"/"repeatchar"/"url"/"advertreward"/
"misc") and severity (int 0..3 OR token "warn"/"replace"/
"drop"/"mute"). caseSensitive accepts bool or int.

pattern and replacement serialize as plain JSON strings —
operators editing the JSON sidecar can hand-craft new
moderation patterns without binary tooling. Strings are
nlohmann::json-escaped on export and unescaped on import,
preserving literal special characters byte-identically.

All 3 presets (spam/caps/url) byte-identical roundtrip
OK. CLI flag count 1239 -> 1241.
This commit is contained in:
Kelsi 2026-05-10 02:36:32 -07:00
parent 7d201cd6f3
commit 4be543a2ed
3 changed files with 187 additions and 0 deletions

View file

@ -358,6 +358,7 @@ const char* const kArgRequired[] = {
"--export-wtrd-json", "--import-wtrd-json",
"--gen-wfl", "--gen-wfl-caps", "--gen-wfl-url",
"--info-wwfl", "--validate-wwfl",
"--export-wwfl-json", "--import-wwfl-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",