From d1a78dcf5290dcee6da6af427a75f69eed00197e Mon Sep 17 00:00:00 2001 From: hebohang Date: Tue, 27 Dec 2022 11:53:26 +0800 Subject: [PATCH 1/2] fix type std::vector> reflection generator bug --- .../source/meta_parser/parser/generator/reflection_generator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/source/meta_parser/parser/generator/reflection_generator.cpp b/engine/source/meta_parser/parser/generator/reflection_generator.cpp index 7f7a530e5..7862f95bf 100644 --- a/engine/source/meta_parser/parser/generator/reflection_generator.cpp +++ b/engine/source/meta_parser/parser/generator/reflection_generator.cpp @@ -91,6 +91,7 @@ namespace Generator std::string array_useful_name = vector_item.second.first; std::string item_type = vector_item.second.second; Mustache::data vector_define; + Utils::replace(array_useful_name, ',', '_'); vector_define.set("vector_useful_name", array_useful_name); vector_define.set("vector_type_name", vector_item.first); vector_define.set("vector_element_type_name", item_type); From 6b987352d7bc58b0db5a15e3e965ac05306f459c Mon Sep 17 00:00:00 2001 From: hebohang Date: Tue, 27 Dec 2022 11:55:19 +0800 Subject: [PATCH 2/2] fix a typo --- .../meta_parser/parser/generator/serializer_generator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/source/meta_parser/parser/generator/serializer_generator.cpp b/engine/source/meta_parser/parser/generator/serializer_generator.cpp index cce485f1a..b985ea9a6 100644 --- a/engine/source/meta_parser/parser/generator/serializer_generator.cpp +++ b/engine/source/meta_parser/parser/generator/serializer_generator.cpp @@ -29,7 +29,7 @@ namespace Generator { std::string file_path = processFileName(path); - Mustache::data muatache_data; + Mustache::data mustache_data; Mustache::data include_headfiles(Mustache::data::type::list); Mustache::data class_defines(Mustache::data::type::list); @@ -81,10 +81,10 @@ namespace Generator m_class_defines.push_back(class_def); } - muatache_data.set("class_defines", class_defines); - muatache_data.set("include_headfiles", include_headfiles); + mustache_data.set("class_defines", class_defines); + mustache_data.set("include_headfiles", include_headfiles); std::string render_string = - TemplateManager::getInstance()->renderByTemplate("commonSerializerGenFile", muatache_data); + TemplateManager::getInstance()->renderByTemplate("commonSerializerGenFile", mustache_data); Utils::saveFile(render_string, file_path); m_include_headfiles.push_back(