manual123 / cppToUML

Convert C++ files to plantuml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cppToUML

Convert C++ files to plantuml

Usage:

Test the script from the git repo-root by running it with file input:

perl -Ilib cppToUML.pl example/\*

or piped input

cat example/* | perl -Ilib cppToUML.pl

Any of the methods can be combined with plantuml to generate a png by adding an extra pipe

cat example/* | perl -Ilib cppToUML.pl | plantuml -pipe > example.png 

Where -Ilib is needed to find the StoreClass module. The end result of the above command is:

example

Assumptions

Classes/structs and their member parameters and functions all start on a newline with 0 or more space/tab indentation. The occurence of }; on an empty row is interpreted as done parsing current class.

A class or struct followed by : is parsed for inheritance until reading an opening brace.

Covers the following cases

  • Single line member functions
  • Single line member variables
  • Nested classes
  • public, private and protected access modifiers.
  • Multiline inheritance
  • Multiline comments using /**/
  • Multiline member functions
  • Multiline member variables
  • Template member functions
  • Template classes

About

Convert C++ files to plantuml

License:GNU General Public License v3.0


Languages

Language:Perl 87.9%Language:C++ 12.1%