Generate toFileString for structs

parent d9b8f32d
Pipeline #161832 passed with stages
in 38 minutes and 58 seconds
......@@ -30,7 +30,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.1.11-SNAPSHOT</version>
<version>0.1.12-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......
......@@ -12,4 +12,20 @@ ${f.type} ${f.name}<#if f.initializer?has_content> = ${f.initializer}</#if>;
</#list>
};
std::ostream& operator<<(std::ostream& os, const ${viewModel.includeName}& s)
{
os << '{';
<#list viewModel.fields as f>
os << "${f.name}: " << s.${f.name};
<#if f?has_next>os << ", ";</#if>
</#list>
os << '}';
return os;
}
void toFileString(std::ofstream& myfile, const ${viewModel.includeName}& s){
myfile << s;
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment