mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
2.2 KiB
2.2 KiB
JSON Config Writer Input Refactoring Summary
Overview
Converted free functions in json_config_writer_input.cpp to class methods of JsonConfigWriterService.
Files Modified
1. json_config_writer_input.cpp
Changes:
- Changed include from
json_config_writer_internal.hpptojson_config_writer_service.hpp - Changed namespace from
sdl3cpp::services::impl::json_config_writertosdl3cpp::services::impl - Removed anonymous namespace
- Converted
addMappingObject()from free function toJsonConfigWriterService::addMappingObject() - Converted
buildInputSection()from free function toJsonConfigWriterService::buildInputSection() - Updated call sites to use
this->addMappingObject()instead ofaddMappingObject()
Functions Converted:
addMappingObject()- Previously in anonymous namespacebuildInputSection()- Previously in namespace scope
2. json_config_writer_service.hpp
Changes:
- Added includes:
<string>,<unordered_map> - Added forward declarations for rapidjson types (for faster compilation)
- Added private method declarations:
void addMappingObject(...)void buildInputSection(...)
3. json_config_writer_service.cpp
Changes:
- Removed include of
json_config_writer_internal.hpp - Updated call sites to use
this->buildInputSection()instead ofjson_config_writer::buildInputSection()
4. json_config_writer_internal.hpp
Changes:
- Removed declaration of
buildInputSection()(now a class method)
Benefits
- Better encapsulation: Functions are now properly scoped within the class
- Clearer ownership: Methods explicitly belong to JsonConfigWriterService
- Consistency: Follows the same pattern as other refactored methods
- Maintainability: Easier to understand class interface and responsibilities
Testing Notes
- All functionality preserved - no behavioral changes
- Functions maintain exact same signatures (except for class scope)
- Call sites updated to use
this->pointer - Namespace changed from
json_config_writertoimplto match class namespace
Related Refactoring
This is part of a broader effort to convert all free functions in json_config_writer_*.cpp files to class methods.