Skip to content

Commit

Permalink
Use special cppType for bounded strings (#53)
Browse files Browse the repository at this point in the history
* Refs #14562. Special cppType for bounded strings.

Signed-off-by: Miguel Company <[email protected]>

* Refs #14652. New parameter on wstring.

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Jul 1, 2022
1 parent b1ece0a commit ba2da88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public String getTypeIdentifier()
@Override
public String getCppTypename()
{
return getCppTypenameFromStringTemplate().toString();
StringTemplate st = getCppTypenameFromStringTemplate();
st.setAttribute("max_size", m_maxsize);
return st.toString();
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/com/eprosima/idl/templates/Types.stg
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ type_7() ::= <<bool>>

type_9() ::= <<uint8_t>>

type_d() ::= <<std::string>>
type_d(max_size) ::= <<$if(max_size)$eprosima::fastrtps::fixed_string<$max_size$>$else$std::string$endif$>>

type_15() ::= <<std::wstring>>
type_15(max_size) ::= <<std::wstring>>

type_19(key, value, maxsize, empty) ::= <<std::map<$key$, $value$>$empty$>>

Expand Down

0 comments on commit ba2da88

Please sign in to comment.