Convert C++ header files to PlantUML
Project description
Motivation
The purpose of this tool is to convert C++ header files to a UML representation in PlantUML syntax that can be used to generate diagrams with PlantUML.
PlantUML is a program rendering UML diagrams from plain text inputs using an expressive language.
This package generates the text input to PlantUML from C++ header files. Its ambition is limited but it should produce reasonable conversion for simple class hierarchies. It aims at supporting:
class members with properties (private, method, protected), methods with basic qualifiers (static, abstract),
inheritance relationships,
aggregation relationships (very basic support).
The package relies on the CppHeaderParser package for parsing of C++ header files.
Usage
The hpp2plantuml package can be used from the command line or as a module in other applications.
Command line
The command line usage is (hpp2plantuml --help):
usage: hpp2plantuml [-h] -i HEADER-FILE [-o FILE] [--version] hpp2plantuml tool. optional arguments: -h, --help show this help message and exit -i HEADER-FILE, --input-file HEADER-FILE input file (must be quoted when using wildcards) -o FILE, --output-file FILE output file --version show program's version number and exit
Input files are added using the -i option. Inputs can be full file paths or include wildcards. Note that double quotes are required when using wildcards. The output file is selected with the -o option. The output is a text file following the PlantUML syntax.
For instance, the following command will generate an input file for PlantUML (output.puml) from several header files.
hpp2plantuml -i File_1.hpp -i "include/Helper_*.hpp" -o output.puml
Module
To use as a module, simply import hpp2plantuml. The CreatePlantUMLFile function can then be used to create a PlantUML file from a set of input files. Alternatively, the Diagram object can be used directly to build internal objects (from files or strings). The Diagram.render() method can be used to produce a string output instead of writing to a text file.
Installation
Using pip
The package is available on PyPi and can be installed using pip:
pip install hpp2plantuml
From source
The code uses setuptools, so it can be built using:
python setup.py install
To build the documentation, run:
python setup.py sphinx
To run the tests, run:
python setup.py test
The full documentation is available via:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for hpp2plantuml-0.4.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb1991906edeb568548059a7bad3ec244bf1c40509a555ed038bc5087e851a6 |
|
MD5 | 57b1e377609f40fbca47e7967dcceece |
|
BLAKE2b-256 | fffb463ad31b76479660180469dfdc43581d68e06b0b4f5aec502efbd5076d19 |
Hashes for hpp2plantuml-0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4e6625061b46f6822de45f970dcec58f37b2000b47009e3899500d0d82167f6 |
|
MD5 | 210aadefac4d7a3107e2f39b9e590ccb |
|
BLAKE2b-256 | 6204663037f1729dcd11859ffff3430b354d72f6a1f0a4d05e05438162d9e417 |