What problem does it solve?
Writing JSON handling code in the MaaEnd cpp-algo module requires knowing the meojson library's specific API patterns, macro system, and error-handling conventions, and mistakes like silently swallowing parse failures or throwing on missing required fields cause subtle bugs.
Core Features & Use Cases
- Safe Parsing Patterns: Provides recommended templates for parsing custom recognition parameters with proper optional checks, error logging, and early returns instead of exception-prone shortcuts.
- Struct Jsonization: Documents the MEO_JSONIZATION macro family (MEO_OPT, MEO_KEY, MEO_TOJSON, MEO_FROMJSON) for bidirectional struct-to-JSON conversion with required and optional fields.
- Custom Type Support: Explains ext::jsonization specializations for types like cv::Rect and cv::Point, plus enum reflection via MEOJSON_ENUM_RANGE.
- Use Case: When implementing a new custom recognition algorithm in agent/cpp-algo that accepts JSON parameters, use this Skill to correctly parse the param string, deserialize it into a struct with optional fields, and write JSON detail output.
Quick Start
Ask the assistant to write a cpp-algo custom recognition param struct using meojson with safe parsing and MEO_JSONIZATION serialization.