Skip to main content

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 module 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).

Usage

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] [-o FILE] -i HEADER-FILE

hpp2plantuml tool.

optional arguments:
  -h, --help            show this help message and exit
  -o FILE, --output-file FILE
                        Output file
  -i HEADER-FILE, --input-file HEADER-FILE
                        Input file (must be quoted when using wildcards)

Input files are added using the -i option. Inputs can be file paths or include wildcards. Note that the 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 the input file for PlantUML from several header files and store the output to the output.puml file.

hpp2plantuml -i File_1.hpp -i "include/Helper_*.hpp" -o output.puml

Module

To use as a module, simply import hpp2plantuml. The CreatePlantUMLFile 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hpp2plantuml, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size hpp2plantuml-0.1-py2.py3-none-any.whl (15.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size hpp2plantuml-0.1.tar.gz (45.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page