ITADN

How to add string condition matching judgment to the. stg template? If I add this syntax, it will report an error; Without this condition, the template can be generated normally. I am not very familiar with ST syntax. Can you help me solve this problem

#324OpenEternity1987 创建于 2025-06-04
E
Eternity1987commented
``` $if(struct.scopedname.first()=="shm_msgs")$` // Skip NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT for shm_msgs namespace $else$ #ifndef SWIG #include <nlohmann/json.hpp> NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT($struct.name$,$\n$$struct.members:{m |$m.name$}; separator=", "$) #endif $endif$ ``` How to add string condition matching judgment to the. stg template? If I add this syntax, it will report an error; Without this condition, the template can be generated normally. I am not very familiar with ST syntax. Can you help me solve this problem
1 条评论