浏览该文件的文档.
26 #include "mscgen_api.h"
35 std::ifstream f(mapName.
str(),std::ifstream::in);
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));
43 const int maxLineLen=1024;
48 while (getline(f,line))
52 if (
qstrncmp(line.c_str(),
"rect",4)==0)
55 sscanf(line.c_str(),
"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
60 sscanf(line.c_str(),
"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
64 if (y2<y1) {
int temp=y2; y2=y1; y1=temp; }
65 if (x2<x1) {
int temp=x2; x2=x1; x1=temp; }
74 std::unique_ptr<DocRef> df {
createRef( *parser.get(), url, context ) };
77 if (!df->anchor().isEmpty()) t <<
"#" << df->anchor();
83 t <<
"\" shape=\"rect\" coords=\""
84 << x1 <<
"," << y1 <<
"," << x2 <<
"," << y2 <<
"\""
101 mscgen_format_t msc_format;
106 msc_format = mscgen_format_png;
110 msc_format = mscgen_format_eps;
114 msc_format = mscgen_format_svg;
121 if ((code=mscgen_generate(inFile.
data(),imgName.
data(),msc_format))!=0)
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));
131 epstopdfArgs.
sprintf(
"\"%s.eps\" --outfile=\"%s.pdf\"",
136 err_full(srcFile,srcLine,
"Problems running epstopdf when processing '%s.eps'. Check your TeX installation!\n",
148 bool writeSVGMap,
const QCString &srcFile,
int srcLine)
153 if ((code=mscgen_generate(inFile.
data(),outFile.
data(),
154 writeSVGMap ? mscgen_format_svgmap : mscgen_format_pngmap))!=0)
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));
180 t <<
"<img src=\"" << relPath << baseName <<
".";
199 << baseName <<
"\" border=\"0\" usemap=\"#" << mapName <<
"\"/>\n";
200 t <<
"<map name=\"" << mapName <<
"\" id=\"" << mapName <<
"\">" << imap <<
"</map>\n";
204 t <<
"\" alt=\"" << baseName <<
"\" border=\"0\"/>\n";
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)
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Class representing a directory in the file system
bool isEmpty() const
Returns TRUE iff the string is empty
static IndexList * indexList
static QCString getMscImageMapFromFile(const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &context, bool writeSVGMap, const QCString &srcFile, int srcLine)
static const int maxCmdLine
void err(const char *fmt,...)
Text streaming class that buffers data.
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, const QCString &context)
int qstrncmp(const char *str1, const char *str2, size_t len)
QCString addHtmlExtensionIfMissing(const QCString &fName)
void addImageFile(const QCString &name)
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
std::string str() const
Return the contents of the buffer as a std::string object
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
DocRef * createRef(IDocParser &parserIntf, const QCString &target, const QCString &context)
#define Config_getBool(name)
const char * qPrint(const char *s)
void err_full(const QCString &file, int line, const char *fmt,...)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
int qstrcmp(const char *str1, const char *str2)
Portable versions of functions that are platform dependent.
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
A bunch of utility functions.
QCString & sprintf(const char *format,...)
std::unique_ptr< IDocParser > createDocParser()
This is an alternative implementation of QCString.