Doxygen
Toggle main menu visibility
Loading...
Searching...
No Matches
plantuml.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
* Copyright (C) 1997-2015 by Dimitri van Heesch.
4
*
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation under the terms of the GNU General Public License is hereby
7
* granted. No representations are made about the suitability of this software
8
* for any purpose. It is provided "as is" without express or implied warranty.
9
* See the GNU General Public License for more details.
10
*
11
* Documents produced by Doxygen are derivative works derived from the
12
* input used in their production; they are not affected by this license.
13
*
14
*/
15
16
#ifndef PLANTUML_H
17
#define PLANTUML_H
18
19
#include <map>
20
#include <string>
21
22
#include "
containers.h
"
23
#include "
qcstring.h
"
24
25
#define DIVIDE_COUNT 4
26
#define MIN_PLANTUML_COUNT 8
27
28
class
QCString
;
29
struct
PlantumlContent
30
{
31
PlantumlContent
(
const
QCString
&content_,
const
QCString
&outDir_,
const
QCString
&srcFile_,
int
srcLine_)
32
:
content
(content_),
outDir
(outDir_),
srcFile
(srcFile_),
srcLine
(srcLine_) {}
33
QCString
content
;
34
QCString
outDir
;
35
QCString
srcFile
;
36
int
srcLine
;
37
};
38
39
/** Singleton that manages plantuml relation actions */
40
class
PlantumlManager
41
{
42
public
:
43
/** Plant UML output image formats */
44
enum
OutputFormat
{
PUML_BITMAP
,
PUML_EPS
,
PUML_SVG
};
45
46
static
PlantumlManager
&
instance
();
47
48
/** Run plant UML tool for all images */
49
void
run
();
50
51
/** Write a PlantUML compatible file.
52
* @param[in] outDirArg the output directory to write the file to.
53
* @param[in] fileName the name of the file. If empty a name will be chosen automatically.
54
* @param[in] content the contents of the PlantUML file.
55
* @param[in] format the image format to generate.
56
* @param[in] engine the plantuml engine to use.
57
* @param[in] srcFile the source file resulting in the write command.
58
* @param[in] srcLine the line number resulting in the write command.
59
* @param[in] inlineCode the code is coming from the `\statuml ... \enduml` (`true`) command or
60
* from the `\planumlfile` command (`false`)
61
* @returns The names of the generated files.
62
*/
63
StringVector
writePlantUMLSource
(
const
QCString
&outDirArg,
const
QCString
&fileName,
64
const
QCString
&content,
OutputFormat
format,
65
const
QCString
&engine,
const
QCString
&srcFile,
66
int
srcLine,
bool
inlineCode);
67
68
/** Convert a PlantUML file to an image.
69
* @param[in] baseName the name of the generated file (as returned by writePlantUMLSource())
70
* @param[in] outDir the directory to write the resulting image into.
71
* @param[in] format the image format to generate.
72
*/
73
void
generatePlantUMLOutput
(
const
QCString
&baseName,
const
QCString
&outDir,
OutputFormat
format);
74
75
using
FilesMap
= std::map< std::string, StringVector >;
76
using
ContentMap
= std::map< std::string, PlantumlContent >;
77
private
:
78
PlantumlManager
();
79
void
insert
(
const
std::string &key,
80
const
std::string &value,
81
const
QCString
&outDir,
82
OutputFormat
format,
83
const
QCString
&puContent,
84
const
QCString
&srcFile,
85
int
srcLine);
86
void
generatePlantUmlFileNames
(
const
QCString
&fileName,
OutputFormat
format,
const
QCString
&outDir,
87
QCString
&baseName,
QCString
&puName,
QCString
&imgName);
88
89
FilesMap
m_pngPlantumlFiles
;
90
FilesMap
m_svgPlantumlFiles
;
91
FilesMap
m_epsPlantumlFiles
;
92
ContentMap
m_pngPlantumlContent
;
// use circular queue for using multi-processor (multi threading)
93
ContentMap
m_svgPlantumlContent
;
94
ContentMap
m_epsPlantumlContent
;
95
};
96
97
#endif
98
PlantumlManager
Singleton that manages plantuml relation actions.
Definition
plantuml.h:41
PlantumlManager::m_pngPlantumlContent
ContentMap m_pngPlantumlContent
Definition
plantuml.h:92
PlantumlManager::ContentMap
std::map< std::string, PlantumlContent > ContentMap
Definition
plantuml.h:76
PlantumlManager::OutputFormat
OutputFormat
Plant UML output image formats.
Definition
plantuml.h:44
PlantumlManager::PUML_BITMAP
@ PUML_BITMAP
Definition
plantuml.h:44
PlantumlManager::PUML_SVG
@ PUML_SVG
Definition
plantuml.h:44
PlantumlManager::PUML_EPS
@ PUML_EPS
Definition
plantuml.h:44
PlantumlManager::m_epsPlantumlContent
ContentMap m_epsPlantumlContent
Definition
plantuml.h:94
PlantumlManager::generatePlantUmlFileNames
void generatePlantUmlFileNames(const QCString &fileName, OutputFormat format, const QCString &outDir, QCString &baseName, QCString &puName, QCString &imgName)
Definition
plantuml.cpp:168
PlantumlManager::FilesMap
std::map< std::string, StringVector > FilesMap
Definition
plantuml.h:75
PlantumlManager::insert
void insert(const std::string &key, const std::string &value, const QCString &outDir, OutputFormat format, const QCString &puContent, const QCString &srcFile, int srcLine)
Definition
plantuml.cpp:447
PlantumlManager::writePlantUMLSource
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition
plantuml.cpp:31
PlantumlManager::m_svgPlantumlContent
ContentMap m_svgPlantumlContent
Definition
plantuml.h:93
PlantumlManager::m_pngPlantumlFiles
FilesMap m_pngPlantumlFiles
Definition
plantuml.h:89
PlantumlManager::instance
static PlantumlManager & instance()
Definition
plantuml.cpp:231
PlantumlManager::PlantumlManager
PlantumlManager()
Definition
plantuml.cpp:237
PlantumlManager::m_svgPlantumlFiles
FilesMap m_svgPlantumlFiles
Definition
plantuml.h:90
PlantumlManager::run
void run()
Run plant UML tool for all images.
Definition
plantuml.cpp:389
PlantumlManager::generatePlantUMLOutput
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition
plantuml.cpp:202
PlantumlManager::m_epsPlantumlFiles
FilesMap m_epsPlantumlFiles
Definition
plantuml.h:91
QCString
This is an alternative implementation of QCString.
Definition
qcstring.h:101
containers.h
StringVector
std::vector< std::string > StringVector
Definition
containers.h:33
qcstring.h
PlantumlContent::srcLine
int srcLine
Definition
plantuml.h:36
PlantumlContent::srcFile
QCString srcFile
Definition
plantuml.h:35
PlantumlContent::outDir
QCString outDir
Definition
plantuml.h:34
PlantumlContent::content
QCString content
Definition
plantuml.h:33
PlantumlContent::PlantumlContent
PlantumlContent(const QCString &content_, const QCString &outDir_, const QCString &srcFile_, int srcLine_)
Definition
plantuml.h:31
src
plantuml.h
Generated by
1.17.0