Doxygen
PlantumlManager类 参考

Singleton that manages plantuml relation actions 更多...

#include <plantuml.h>

Public 类型

enum  OutputFormat { PUML_BITMAP, PUML_EPS, PUML_SVG }
 Plant UML output image formats 更多...
 
using FilesMap = std::map< std::string, StringVector >
 
using ContentMap = std::map< std::string, PlantumlContent >
 

Public 成员函数

void run ()
 Run plant UML tool for all images 更多...
 
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. 更多...
 
void generatePlantUMLOutput (const QCString &baseName, const QCString &outDir, OutputFormat format)
 Convert a PlantUML file to an image. 更多...
 

静态 Public 成员函数

static PlantumlManagerinstance ()
 

Private 成员函数

 PlantumlManager ()
 
void insert (const std::string &key, const std::string &value, const QCString &outDir, OutputFormat format, const QCString &puContent, const QCString &srcFile, int srcLine)
 

Private 属性

FilesMap m_pngPlantumlFiles
 
FilesMap m_svgPlantumlFiles
 
FilesMap m_epsPlantumlFiles
 
ContentMap m_pngPlantumlContent
 
ContentMap m_svgPlantumlContent
 
ContentMap m_epsPlantumlContent
 

详细描述

Singleton that manages plantuml relation actions

在文件 plantuml.h40 行定义.

成员类型定义说明

◆ ContentMap

using PlantumlManager::ContentMap = std::map< std::string, PlantumlContent >

在文件 plantuml.h74 行定义.

◆ FilesMap

using PlantumlManager::FilesMap = std::map< std::string, StringVector >

在文件 plantuml.h73 行定义.

成员枚举类型说明

◆ OutputFormat

Plant UML output image formats

枚举值
PUML_BITMAP 
PUML_EPS 
PUML_SVG 

在文件 plantuml.h44 行定义.

构造及析构函数说明

◆ PlantumlManager()

PlantumlManager::PlantumlManager ( )
private

在文件 plantuml.cpp130 行定义.

131 {
132 }

成员函数说明

◆ generatePlantUMLOutput()

void PlantumlManager::generatePlantUMLOutput ( const QCString baseName,
const QCString outDir,
OutputFormat  format 
)

Convert a PlantUML file to an image.

参数
[in]baseNamethe name of the generated file (as returned by writePlantUMLSource())
[in]outDirthe directory to write the resulting image into.
[in]formatthe image format to generate.

在文件 plantuml.cpp91 行定义.

92 {
93  QCString plantumlJarPath = Config_getString(PLANTUML_JAR_PATH);
94  QCString plantumlConfigFile = Config_getString(PLANTUML_CFG_FILE);
95  QCString dotPath = Config_getString(DOT_PATH);
96 
97  QCString imgName = baseName;
98  // The basename contains path, we need to strip the path from the filename in order
99  // to create the image file name which should be included in the index.qhp (Qt help index file).
100  int i;
101  if ((i=imgName.findRev('/'))!=-1) // strip path
102  {
103  imgName=imgName.right(imgName.length()-i-1);
104  }
105  switch (format)
106  {
107  case PUML_BITMAP:
108  imgName+=".png";
109  break;
110  case PUML_EPS:
111  imgName+=".eps";
112  break;
113  case PUML_SVG:
114  imgName+=".svg";
115  break;
116  }
117 
119 }

引用了 IndexList::addImageFile(), Config_getString, QCString::findRev(), Doxygen::indexList, QCString::length(), PUML_BITMAP, PUML_EPS, PUML_SVG , 以及 QCString::right().

被这些函数引用 FlowChart::printUmlTree(), HtmlDocVisitor::writePlantUMLFile(), DocbookDocVisitor::writePlantUMLFile(), RTFDocVisitor::writePlantUMLFile() , 以及 LatexDocVisitor::writePlantUMLFile().

◆ insert()

void PlantumlManager::insert ( const std::string &  key,
const std::string &  value,
const QCString outDir,
OutputFormat  format,
const QCString puContent,
const QCString srcFile,
int  srcLine 
)
private

在文件 plantuml.cpp340 行定义.

343 {
344  Debug::print(Debug::Plantuml,0,"*** %s key:%s ,value:%s\n","PlantumlManager::insert",qPrint(key),qPrint(value));
345 
346  switch (format)
347  {
348  case PUML_BITMAP:
351  addPlantumlContent(m_pngPlantumlContent,key,outDir,puContent,srcFile,srcLine);
353  break;
354  case PUML_EPS:
357  addPlantumlContent(m_epsPlantumlContent,key,outDir,puContent,srcFile,srcLine);
359  break;
360  case PUML_SVG:
363  addPlantumlContent(m_svgPlantumlContent,key,outDir,puContent,srcFile,srcLine);
365  break;
366  }
367 }

引用了 addPlantumlContent(), addPlantumlFiles(), m_epsPlantumlContent, m_epsPlantumlFiles, m_pngPlantumlContent, m_pngPlantumlFiles, m_svgPlantumlContent, m_svgPlantumlFiles, Debug::Plantuml, Debug::print(), print(), PUML_BITMAP, PUML_EPS, PUML_SVG , 以及 qPrint().

被这些函数引用 writePlantUMLSource().

◆ instance()

◆ run()

◆ writePlantUMLSource()

QCString PlantumlManager::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.

参数
[in]outDirthe output directory to write the file to.
[in]fileNamethe name of the file. If empty a name will be chosen automatically.
[in]contentthe contents of the PlantUML file.
[in]formatthe image format to generate.
[in]enginethe plantuml engine to use.
[in]srcFilethe source file resulting in the write command.
[in]srcLinethe line number resulting in the write command.
返回
The name of the generated file.

在文件 plantuml.cpp26 行定义.

29 {
30  QCString baseName;
31  QCString puName;
32  QCString imgName;
33  QCString outDir(outDirArg);
34  static int umlindex=1;
35 
36  Debug::print(Debug::Plantuml,0,"*** %s fileName: %s\n","writePlantUMLSource",qPrint(fileName));
37  Debug::print(Debug::Plantuml,0,"*** %s outDir: %s\n","writePlantUMLSource",qPrint(outDir));
38 
39  // strip any trailing slashes and backslashes
40  uint l;
41  while ((l=outDir.length())>0 && (outDir.at(l-1)=='/' || outDir.at(l-1)=='\\'))
42  {
43  outDir = outDir.left(l-1);
44  }
45 
46  if (fileName.isEmpty()) // generate name
47  {
48  puName = "inline_umlgraph_"+QCString().setNum(umlindex);
49  baseName = outDir+"/inline_umlgraph_"+QCString().setNum(umlindex++);
50  }
51  else // user specified name
52  {
53  baseName = fileName;
54  int i=baseName.findRev('.');
55  if (i!=-1) baseName = baseName.left(i);
56  puName = baseName;
57  baseName.prepend(outDir+"/");
58  }
59 
60  switch (format)
61  {
62  case PUML_BITMAP:
63  imgName =puName+".png";
64  break;
65  case PUML_EPS:
66  imgName =puName+".eps";
67  break;
68  case PUML_SVG:
69  imgName =puName+".svg";
70  break;
71  }
72 
73  Debug::print(Debug::Plantuml,0,"*** %s baseName: %s\n","writePlantUMLSource",qPrint(baseName));
74  Debug::print(Debug::Plantuml,0,"*** %s puName: %s\n","writePlantUMLSource",qPrint(puName));
75  Debug::print(Debug::Plantuml,0,"*** %s imgName: %s\n","writePlantUMLSource",qPrint(imgName));
76 
77  QCString text = "@start"+engine+" "+imgName+"\n";
78  text+=content;
79  text+="\n@end"+engine+"\n";
80 
81  QCString qcOutDir(outDir);
82  uint pos = qcOutDir.findRev("/");
83  QCString generateType(qcOutDir.right(qcOutDir.length() - (pos + 1)) );
84  Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
85  PlantumlManager::instance().insert(generateType.str(),puName.str(),outDir,format,text,srcFile,srcLine);
86  Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
87 
88  return baseName;
89 }

引用了 QCString::at(), QCString::findRev(), insert(), instance(), QCString::isEmpty(), QCString::left(), QCString::length(), Debug::Plantuml, QCString::prepend(), Debug::print(), PUML_BITMAP, PUML_EPS, PUML_SVG, QCString::QCString(), qPrint(), QCString::right() , 以及 QCString::str().

被这些函数引用 FlowChart::printUmlTree(), HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit() , 以及 RTFDocVisitor::visit().

类成员变量说明

◆ m_epsPlantumlContent

ContentMap PlantumlManager::m_epsPlantumlContent
private

在文件 plantuml.h90 行定义.

被这些函数引用 insert() , 以及 run().

◆ m_epsPlantumlFiles

FilesMap PlantumlManager::m_epsPlantumlFiles
private

在文件 plantuml.h87 行定义.

被这些函数引用 insert() , 以及 run().

◆ m_pngPlantumlContent

ContentMap PlantumlManager::m_pngPlantumlContent
private

在文件 plantuml.h88 行定义.

被这些函数引用 insert() , 以及 run().

◆ m_pngPlantumlFiles

FilesMap PlantumlManager::m_pngPlantumlFiles
private

在文件 plantuml.h85 行定义.

被这些函数引用 insert() , 以及 run().

◆ m_svgPlantumlContent

ContentMap PlantumlManager::m_svgPlantumlContent
private

在文件 plantuml.h89 行定义.

被这些函数引用 insert() , 以及 run().

◆ m_svgPlantumlFiles

FilesMap PlantumlManager::m_svgPlantumlFiles
private

在文件 plantuml.h86 行定义.

被这些函数引用 insert() , 以及 run().


该类的文档由以下文件生成:
PlantumlManager::m_epsPlantumlContent
ContentMap m_epsPlantumlContent
Definition: plantuml.h:90
runPlantumlContent
static void runPlantumlContent(const PlantumlManager::FilesMap &plantumlFiles, const PlantumlManager::ContentMap &plantumlContent, PlantumlManager::OutputFormat format)
Definition: plantuml.cpp:134
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
PlantumlManager::m_epsPlantumlFiles
FilesMap m_epsPlantumlFiles
Definition: plantuml.h:87
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
PlantumlManager::m_pngPlantumlFiles
FilesMap m_pngPlantumlFiles
Definition: plantuml.h:85
Doxygen::indexList
static IndexList * indexList
Definition: doxygen.h:114
QCString::str
std::string str() const
Definition: qcstring.h:442
PlantumlManager::instance
static PlantumlManager & instance()
Definition: plantuml.cpp:124
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
addPlantumlContent
static void addPlantumlContent(PlantumlManager::ContentMap &plantumlContent, const std::string &key, const QCString &outDir, const QCString &puContent, const QCString &srcFile, int srcLine)
Definition: plantuml.cpp:328
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
uint
unsigned uint
Definition: qcstring.h:40
PlantumlManager::PUML_BITMAP
@ PUML_BITMAP
Definition: plantuml.h:44
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
IndexList::addImageFile
void addImageFile(const QCString &name)
Definition: index.h:105
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
addPlantumlFiles
static void addPlantumlFiles(PlantumlManager::FilesMap &plantumlFiles, const std::string &key, const std::string &value)
Definition: plantuml.cpp:317
Debug::print
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition: debug.cpp:57
PlantumlManager
Singleton that manages plantuml relation actions
Definition: plantuml.h:40
print
static void print(const PlantumlManager::FilesMap &plantumlFiles)
Definition: plantuml.cpp:290
QCString::setNum
QCString & setNum(short n)
Definition: qcstring.h:372
PlantumlManager::PUML_EPS
@ PUML_EPS
Definition: plantuml.h:44
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Config_getString
#define Config_getString(name)
Definition: config.h:32
PlantumlManager::PUML_SVG
@ PUML_SVG
Definition: plantuml.h:44
Debug::Plantuml
@ Plantuml
Definition: debug.h:40
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108