Doxygen
dotfilepatcher.cpp 文件参考
#include <sstream>
#include "dotfilepatcher.h"
#include "dotrunner.h"
#include "config.h"
#include "message.h"
#include "docparser.h"
#include "doxygen.h"
#include "util.h"
#include "dot.h"
#include "dir.h"
+ dotfilepatcher.cpp 的引用(Include)关系图:

浏览源代码.

函数

static QCString replaceRef (const QCString &buf, const QCString &relPath, bool urlOnly, const QCString &context, const QCString &target=QCString())
 
static bool readSVGSize (const QCString &fileName, int *width, int *height)
 
static void writeSVGNotSupported (TextStream &out)
 

变量

static const char svgZoomHeader []
 
static const char svgZoomFooter []
 

函数说明

◆ readSVGSize()

static bool readSVGSize ( const QCString fileName,
int *  width,
int *  height 
)
static

在文件 dotfilepatcher.cpp506 行定义.

507 {
508  bool found=FALSE;
509  std::ifstream f(fileName.str(),std::ifstream::in);
510  if (!f.is_open())
511  {
512  return false;
513  }
514  std::string line;
515  while (getline(f,line) && !found)
516  {
517  if (qstrncmp(line.c_str(),"<!--zoomable ",13)==0)
518  {
519  *width=-1;
520  *height=-1;
521  sscanf(line.c_str(),"<!--zoomable %d",height);
522  found=true;
523  }
524  else if (sscanf(line.c_str(),"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2)
525  {
526  found=true;
527  }
528  }
529  return true;
530 }

引用了 FALSE, qstrncmp() , 以及 QCString::str().

被这些函数引用 DotFilePatcher::writeSVGFigureLink().

◆ replaceRef()

static QCString replaceRef ( const QCString buf,
const QCString relPath,
bool  urlOnly,
const QCString context,
const QCString target = QCString() 
)
static

在文件 dotfilepatcher.cpp126 行定义.

128 {
129  // search for href="...", store ... part in link
130  QCString href = "href";
131  //bool isXLink=FALSE;
132  int len = 6;
133  int indexS = buf.find("href=\""), indexE;
134  bool targetAlreadySet = buf.find("target=")!=-1;
135  if (indexS>5 && buf.find("xlink:href=\"")!=-1) // XLink href (for SVG)
136  {
137  indexS-=6;
138  len+=6;
139  href.prepend("xlink:");
140  //isXLink=TRUE;
141  }
142  if (indexS>=0 && (indexE=buf.find('"',indexS+len))!=-1)
143  {
144  QCString link = buf.mid(indexS+len,indexE-indexS-len);
145  QCString result;
146  if (urlOnly) // for user defined dot graphs
147  {
148  if (link.left(5)=="\\ref " || link.left(5)=="@ref ") // \ref url
149  {
150  result=href+"=\"";
151  // fake ref node to resolve the url
152  std::unique_ptr<IDocParser> parser { createDocParser() };
153  std::unique_ptr<DocRef> df { createRef( *parser.get(), link.mid(5), context ) };
154  result+=externalRef(relPath,df->ref(),TRUE);
155  if (!df->file().isEmpty())
156  result += addHtmlExtensionIfMissing(df->file());
157  if (!df->anchor().isEmpty())
158  result += "#" + df->anchor();
159  result += "\"";
160  }
161  else
162  {
163  result = href+"=\"" + link + "\"";
164  }
165  }
166  else // ref$url (external ref via tag file), or $url (local ref)
167  {
168  int marker = link.find('$');
169  if (marker!=-1)
170  {
171  QCString ref = link.left(marker);
172  QCString url = link.mid(marker+1);
173  if (!ref.isEmpty())
174  {
175  result = externalLinkTarget(true);
176  if (!result.isEmpty())targetAlreadySet=true;
177  }
178  result+= href+"=\"";
179  result+=externalRef(relPath,ref,TRUE);
180  result+= url + "\"";
181  }
182  else // should not happen, but handle properly anyway
183  {
184  result = href+"=\"" + link + "\"";
185  }
186  }
187  if (!target.isEmpty() && !targetAlreadySet)
188  {
189  result+=" target=\""+target+"\"";
190  }
191  QCString leftPart = buf.left(indexS);
192  QCString rightPart = buf.mid(indexE+1);
193  //printf("replaceRef(\n'%s'\n)->\n'%s+%s+%s'\n",
194  // qPrint(buf),qPrint(leftPart),qPrint(result),qPrint(rightPart));
195  return leftPart + result + rightPart;
196  }
197  else
198  {
199  return buf;
200  }
201 }

引用了 addHtmlExtensionIfMissing(), createDocParser(), createRef(), externalLinkTarget(), externalRef(), QCString::find(), QCString::isEmpty(), QCString::left(), QCString::mid(), QCString::prepend() , 以及 TRUE.

被这些函数引用 DotFilePatcher::convertMapFile() , 以及 DotFilePatcher::run().

◆ writeSVGNotSupported()

static void writeSVGNotSupported ( TextStream out)
static

在文件 dotfilepatcher.cpp532 行定义.

533 {
534  out << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
535 }

被这些函数引用 DotFilePatcher::writeSVGFigureLink().

变量说明

◆ svgZoomFooter

const char svgZoomFooter[]
static

在文件 dotfilepatcher.cpp72 行定义.

被这些函数引用 DotFilePatcher::run().

◆ svgZoomHeader

const char svgZoomHeader[]
static

在文件 dotfilepatcher.cpp28 行定义.

被这些函数引用 DotFilePatcher::run().

QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
QCString::str
std::string str() const
Definition: qcstring.h:442
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
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
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
TRUE
#define TRUE
Definition: qcstring.h:36
externalLinkTarget
QCString externalLinkTarget(const bool parent)
Definition: util.cpp:6323
createRef
DocRef * createRef(IDocParser &parserIntf, const QCString &target, const QCString &context)
Definition: docparser.cpp:7675
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
externalRef
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:6334
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
createDocParser
std::unique_ptr< IDocParser > createDocParser()
Definition: docparser.cpp:179
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108