This is a mini-project aiming to create a universal uml generator for c++ projects. This project can be used to create UML-diagrams for C++ projects easily, using only a few commands.
-
Doxygen
https://www.doxygen.nl/manual/index.html
Doxygen is a software(or command line tool) to produce documentation of source codes. It supports languages like C, C++, Python, Java, etc.It generates HTML, LaTeX, or XML documents of the code such that they can be documented or parsed to obtain contents of the code.
In our project,
We use doxygen to generate an XML document of the source code, to get all the classes and properties of the classes of the source code. -
Python/Python3
https://www.python.org/
We use python to use the plantuml library to generate images. -
Plantuml
https://plantuml.com/
https://github.com/SamuelMarks/python-plantuml
PlantUML is an open-source tool allowing users to create diagrams from a specialized plain text language.
In our project,
We use plantuml-python integration(2nd link) to generate a png image from the .pu file already created after parsing the source codeUse command pip install plantuml to install plantuml in your device
We also recommend to use command pip install six for better python compatibility
-
We generate xml documents for the project file using the command tool doxygen.
-
We parse the xml file and create a file classes.txt which contains the names of all the classes.
-
Then we open classes.txt and then read every line to get the name of every class.
-
For each class, we create a txt file and update the contents of each class in a more convenient way using the documented xml into the class_name.txt file.
-
After every class file is created, we use the class files to generate a single plantUml.pu file which contains the data members and member functions of all the classes in the main file.
-
We create the UML diagram using python plantuml library and the .pu file using the command "python -m plantuml plantUml.pu"
- Clone this repository to your local system
- Run main.cpp from your system using git bash or cmd to generate main.exe or main.out file
- Copy main.exe/main.out to your project folder and run it
- You will see plantUml.png file in your folder, which contains the UML diagram
- Can be used for one file only
- Aswajith K K 211104
- Pranshu Goyal 211126