Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cpp code generation #51

Merged
merged 8 commits into from
Apr 13, 2020
Merged

Improve cpp code generation #51

merged 8 commits into from
Apr 13, 2020

Conversation

anliec
Copy link
Contributor

@anliec anliec commented Apr 6, 2020

Changes

Add the following effect during cpp code generation:

  • Properly generate field and methods with the right level of privacy (public/private/protected).
  • Generate .h file instead of .cpp
  • Add #include statement for other class in the puml file
  • Protect against multiple inclusion with preprocessor

Does not change anything for other language.

Tests

The cpp test is not passing anymore, let me know how to update the template, so I can fix that. However, the result for the car.puml file are correct.

Related issues

#50


Thank you for this great code base!

PS: js is not my primary language and I never used handlebars before... My code is based on what is done for ECMAScript6.

anliec added 2 commits April 5, 2020 17:13
 - Properly generate field and methods with the right level of privacy (public/private/protected).
 - Generate .h file instead of .cpp
 - Add #include statement for other class in the puml file
 - Protect against multiple inclusion with preprocessor
@anliec
Copy link
Contributor Author

anliec commented Apr 12, 2020

Added modification to handle template type: issue #52

@jupe
Copy link
Owner

jupe commented Apr 12, 2020

Thanks for PR. There is generated test for each language which just verify generated output:

languages.forEach((lang) => {

you should update this table:

cpp: 'cpp',

which map generated file extension for each language.

and update&rename this file:

https://github.com/jupe/puml2code/blob/master/test/data/car.cpp.cpp

I just activated CI for PR so we can see when everything is ready for merging :)

test/data/car.cpp.h Show resolved Hide resolved
test/data/car.cpp.h Show resolved Hide resolved
@jupe jupe merged commit 9390c70 into jupe:master Apr 13, 2020
This was referenced Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants