Doxygen
plantuml.h
浏览该文件的文档.
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;
30 {
31  PlantumlContent(const QCString &content_, const QCString &outDir_, const QCString &srcFile_, int srcLine_)
32  : content(content_), outDir(outDir_), srcFile(srcFile_), srcLine(srcLine_) {}
36  int srcLine;
37 };
38 
39 /** Singleton that manages plantuml relation actions */
41 {
42  public:
43  /** Plant UML output image formats */
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] outDir 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  * @returns The name of the generated file.
60  */
61  QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,
62  const QCString &content, OutputFormat format,
63  const QCString &engine,const QCString &srcFile,
64  int srcLine);
65 
66  /** Convert a PlantUML file to an image.
67  * @param[in] baseName the name of the generated file (as returned by writePlantUMLSource())
68  * @param[in] outDir the directory to write the resulting image into.
69  * @param[in] format the image format to generate.
70  */
71  void generatePlantUMLOutput(const QCString &baseName,const QCString &outDir,OutputFormat format);
72 
73  using FilesMap = std::map< std::string, StringVector >;
74  using ContentMap = std::map< std::string, PlantumlContent >;
75  private:
77  void insert(const std::string &key,
78  const std::string &value,
79  const QCString &outDir,
80  OutputFormat format,
81  const QCString &puContent,
82  const QCString &srcFile,
83  int srcLine);
84 
88  ContentMap m_pngPlantumlContent; // use circular queue for using multi-processor (multi threading)
91 };
92 
93 #endif
94 
PlantumlManager::m_epsPlantumlContent
ContentMap m_epsPlantumlContent
Definition: plantuml.h:90
PlantumlManager::writePlantUMLSource
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition: plantuml.cpp:26
PlantumlManager::PlantumlManager
PlantumlManager()
Definition: plantuml.cpp:130
PlantumlManager::m_epsPlantumlFiles
FilesMap m_epsPlantumlFiles
Definition: plantuml.h:87
PlantumlManager::OutputFormat
OutputFormat
Plant UML output image formats
Definition: plantuml.h:44
PlantumlContent::PlantumlContent
PlantumlContent(const QCString &content_, const QCString &outDir_, const QCString &srcFile_, int srcLine_)
Definition: plantuml.h:31
PlantumlManager::m_pngPlantumlFiles
FilesMap m_pngPlantumlFiles
Definition: plantuml.h:85
PlantumlManager::ContentMap
std::map< std::string, PlantumlContent > ContentMap
Definition: plantuml.h:74
PlantumlManager::instance
static PlantumlManager & instance()
Definition: plantuml.cpp:124
qcstring.h
PlantumlManager::m_pngPlantumlContent
ContentMap m_pngPlantumlContent
Definition: plantuml.h:88
PlantumlManager::m_svgPlantumlContent
ContentMap m_svgPlantumlContent
Definition: plantuml.h:89
PlantumlManager::m_svgPlantumlFiles
FilesMap m_svgPlantumlFiles
Definition: plantuml.h:86
PlantumlManager::PUML_BITMAP
@ PUML_BITMAP
Definition: plantuml.h:44
PlantumlContent::outDir
QCString outDir
Definition: plantuml.h:34
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:340
PlantumlManager::FilesMap
std::map< std::string, StringVector > FilesMap
Definition: plantuml.h:73
PlantumlManager
Singleton that manages plantuml relation actions
Definition: plantuml.h:40
PlantumlManager::run
void run()
Run plant UML tool for all images
Definition: plantuml.cpp:282
containers.h
PlantumlManager::PUML_EPS
@ PUML_EPS
Definition: plantuml.h:44
PlantumlContent
Definition: plantuml.h:29
PlantumlContent::srcFile
QCString srcFile
Definition: plantuml.h:35
PlantumlContent::srcLine
int srcLine
Definition: plantuml.h:36
PlantumlContent::content
QCString content
Definition: plantuml.h:33
PlantumlManager::PUML_SVG
@ PUML_SVG
Definition: plantuml.h:44
PlantumlManager::generatePlantUMLOutput
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition: plantuml.cpp:91
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108