Doxygen
msc.cpp 文件参考
#include <sstream>
#include "msc.h"
#include "portable.h"
#include "config.h"
#include "message.h"
#include "docparser.h"
#include "doxygen.h"
#include "index.h"
#include "util.h"
#include "mscgen_api.h"
#include "dir.h"
#include "textstream.h"
+ msc.cpp 的引用(Include)关系图:

浏览源代码.

函数

static bool convertMapFile (TextStream &t, const QCString &mapName, const QCString &relPath, const QCString &context)
 
void writeMscGraphFromFile (const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
 
static QCString getMscImageMapFromFile (const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &context, bool writeSVGMap, const QCString &srcFile, int srcLine)
 
void writeMscImageMapFromFile (TextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, MscOutputFormat format, const QCString &srcFile, int srcLine)
 

变量

static const int maxCmdLine = 40960
 

函数说明

◆ convertMapFile()

static bool convertMapFile ( TextStream t,
const QCString mapName,
const QCString relPath,
const QCString context 
)
static

在文件 msc.cpp32 行定义.

34 {
35  std::ifstream f(mapName.str(),std::ifstream::in);
36  if (!f.is_open())
37  {
38  err("failed to open map file %s for inclusion in the docs!\n"
39  "If you installed Graphviz/dot after a previous failing run, \n"
40  "try deleting the output directory and rerun doxygen.\n",qPrint(mapName));
41  return false;
42  }
43  const int maxLineLen=1024;
44  char url[maxLineLen];
45  char ref[maxLineLen];
46  int x1,y1,x2,y2;
47  std::string line;
48  while (getline(f,line))
49  {
50  bool isRef = false;
51  //printf("ReadLine '%s'\n",line.c_str());
52  if (qstrncmp(line.c_str(),"rect",4)==0)
53  {
54  // obtain the url and the coordinates in the order used by graphviz-1.5
55  sscanf(line.c_str(),"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
56 
57  if (qstrcmp(url,"\\ref")==0 || qstrcmp(url,"@ref")==0)
58  {
59  isRef = true;
60  sscanf(line.c_str(),"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
61  }
62 
63  // sanity checks
64  if (y2<y1) { int temp=y2; y2=y1; y1=temp; }
65  if (x2<x1) { int temp=x2; x2=x1; x1=temp; }
66 
67  t << "<area href=\"";
68 
69  if ( isRef )
70  {
71  // handle doxygen \ref tag URL reference
72 
73  std::unique_ptr<IDocParser> parser { createDocParser() };
74  std::unique_ptr<DocRef> df { createRef( *parser.get(), url, context ) };
75  t << externalRef(relPath,df->ref(),TRUE);
76  if (!df->file().isEmpty()) t << addHtmlExtensionIfMissing(df->file());
77  if (!df->anchor().isEmpty()) t << "#" << df->anchor();
78  }
79  else
80  {
81  t << url;
82  }
83  t << "\" shape=\"rect\" coords=\""
84  << x1 << "," << y1 << "," << x2 << "," << y2 << "\""
85  << " alt=\"\"/>\n";
86  }
87  }
88 
89  return true;
90 }

引用了 addHtmlExtensionIfMissing(), createDocParser(), createRef(), err(), externalRef(), qPrint(), qstrcmp(), qstrncmp(), QCString::str() , 以及 TRUE.

被这些函数引用 getMscImageMapFromFile().

◆ getMscImageMapFromFile()

static QCString getMscImageMapFromFile ( const QCString inFile,
const QCString outDir,
const QCString relPath,
const QCString context,
bool  writeSVGMap,
const QCString srcFile,
int  srcLine 
)
static

在文件 msc.cpp146 行定义.

149 {
150  QCString outFile = inFile + ".map";
151 
152  int code;
153  if ((code=mscgen_generate(inFile.data(),outFile.data(),
154  writeSVGMap ? mscgen_format_svgmap : mscgen_format_pngmap))!=0)
155  {
156  err_full(srcFile,srcLine,"Problems generating msc output (error=%s). Look for typos in you msc file %s\n",
157  mscgen_error2str(code),qPrint(inFile));
158  return "";
159  }
160 
161  TextStream t;
162  convertMapFile(t, outFile, relPath, context);
163 
164  Dir().remove(outFile.str());
165 
166  return t.str();
167 }

引用了 convertMapFile(), QCString::data(), err_full(), qPrint(), Dir::remove(), TextStream::str() , 以及 QCString::str().

被这些函数引用 writeMscImageMapFromFile().

◆ writeMscGraphFromFile()

void writeMscGraphFromFile ( const QCString inFile,
const QCString outDir,
const QCString outFile,
MscOutputFormat  format,
const QCString srcFile,
int  srcLine 
)

在文件 msc.cpp92 行定义.

96 {
97  QCString absOutFile = outDir;
98  absOutFile+=Portable::pathSeparator();
99  absOutFile+=outFile;
100 
101  mscgen_format_t msc_format;
102  QCString imgName = absOutFile;
103  switch (format)
104  {
105  case MSC_BITMAP:
106  msc_format = mscgen_format_png;
107  imgName+=".png";
108  break;
109  case MSC_EPS:
110  msc_format = mscgen_format_eps;
111  imgName+=".eps";
112  break;
113  case MSC_SVG:
114  msc_format = mscgen_format_svg;
115  imgName+=".svg";
116  break;
117  default:
118  return;
119  }
120  int code;
121  if ((code=mscgen_generate(inFile.data(),imgName.data(),msc_format))!=0)
122  {
123  err_full(srcFile,srcLine,"Problems generating msc output (error=%s). Look for typos in you msc file %s\n",
124  mscgen_error2str(code),qPrint(inFile));
125  return;
126  }
127 
128  if ( (format==MSC_EPS) && (Config_getBool(USE_PDFLATEX)) )
129  {
130  QCString epstopdfArgs(maxCmdLine);
131  epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
132  qPrint(absOutFile),qPrint(absOutFile));
134  if (Portable::system("epstopdf",epstopdfArgs)!=0)
135  {
136  err_full(srcFile,srcLine,"Problems running epstopdf when processing '%s.eps'. Check your TeX installation!\n",
137  qPrint(absOutFile));
138  }
140  }
141 
143 
144 }

引用了 IndexList::addImageFile(), Config_getBool, QCString::data(), err_full(), Doxygen::indexList, maxCmdLine, MSC_BITMAP, MSC_EPS, MSC_SVG, Portable::pathSeparator(), qPrint(), QCString::sprintf(), Portable::system(), Portable::sysTimerStart() , 以及 Portable::sysTimerStop().

被这些函数引用 DocbookDocVisitor::startMscFile(), LatexDocVisitor::startMscFile(), DocbookDocVisitor::writeMscFile(), HtmlDocVisitor::writeMscFile(), RTFDocVisitor::writeMscFile() , 以及 LatexDocVisitor::writeMscFile().

◆ writeMscImageMapFromFile()

void writeMscImageMapFromFile ( TextStream t,
const QCString inFile,
const QCString outDir,
const QCString relPath,
const QCString baseName,
const QCString context,
MscOutputFormat  format,
const QCString srcFile,
int  srcLine 
)

在文件 msc.cpp169 行定义.

178 {
179  QCString mapName = baseName+".map";
180  t << "<img src=\"" << relPath << baseName << ".";
181  switch (format)
182  {
183  case MSC_BITMAP:
184  t << "png";
185  break;
186  case MSC_EPS:
187  t << "eps";
188  break;
189  case MSC_SVG:
190  t << "svg";
191  break;
192  default:
193  t << "unknown";
194  }
195  QCString imap = getMscImageMapFromFile(inFile,outDir,relPath,context,format==MSC_SVG,srcFile,srcLine);
196  if (!imap.isEmpty())
197  {
198  t << "\" alt=\""
199  << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
200  t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>\n";
201  }
202  else
203  {
204  t << "\" alt=\"" << baseName << "\" border=\"0\"/>\n";
205  }
206 }

引用了 getMscImageMapFromFile(), QCString::isEmpty(), MSC_BITMAP, MSC_EPS , 以及 MSC_SVG.

被这些函数引用 HtmlDocVisitor::writeMscFile().

变量说明

◆ maxCmdLine

const int maxCmdLine = 40960
static

在文件 msc.cpp30 行定义.

被这些函数引用 writeMscGraphFromFile().

Portable::pathSeparator
QCString pathSeparator()
Definition: portable.cpp:347
Dir::remove
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:256
Dir
Class representing a directory in the file system
Definition: dir.h:68
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
Doxygen::indexList
static IndexList * indexList
Definition: doxygen.h:114
MSC_BITMAP
@ MSC_BITMAP
Definition: msc.h:22
QCString::str
std::string str() const
Definition: qcstring.h:442
getMscImageMapFromFile
static QCString getMscImageMapFromFile(const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &context, bool writeSVGMap, const QCString &srcFile, int srcLine)
Definition: msc.cpp:146
MSC_EPS
@ MSC_EPS
Definition: msc.h:22
maxCmdLine
static const int maxCmdLine
Definition: msc.cpp:30
err
void err(const char *fmt,...)
Definition: message.cpp:203
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
convertMapFile
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, const QCString &context)
Definition: msc.cpp:32
qstrncmp
int qstrncmp(const char *str1, const char *str2, size_t len)
Definition: qcstring.h:91
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
Portable::sysTimerStart
void sysTimerStart()
Definition: portable.cpp:470
IndexList::addImageFile
void addImageFile(const QCString &name)
Definition: index.h:105
TRUE
#define TRUE
Definition: qcstring.h:36
Portable::system
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition: portable.cpp:42
MSC_SVG
@ MSC_SVG
Definition: msc.h:22
TextStream::str
std::string str() const
Return the contents of the buffer as a std::string object
Definition: textstream.h:208
createRef
DocRef * createRef(IDocParser &parserIntf, const QCString &target, const QCString &context)
Definition: docparser.cpp:7675
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
err_full
void err_full(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:212
Portable::sysTimerStop
void sysTimerStop()
Definition: portable.cpp:475
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
qstrcmp
int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:82
externalRef
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:6334
createDocParser
std::unique_ptr< IDocParser > createDocParser()
Definition: docparser.cpp:179
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108