Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
9e854ab3
Commit
9e854ab3
authored
Jul 17, 2019
by
Alexander David Hellwig
Browse files
Generate toFileString for structs
parent
d9b8f32d
Pipeline
#161832
passed with stages
in 38 minutes and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
9e854ab3
...
...
@@ -30,7 +30,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-math-generator
</artifactId>
<version>
0.1.1
1
-SNAPSHOT
</version>
<version>
0.1.1
2
-SNAPSHOT
</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
...
...
src/main/resources/template/type/Struct.ftl
View file @
9e854ab3
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment