Skip to content

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 #324

Description

@Eternity1987
$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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions