Doxygen
DocbookCodeGenerator类 参考

#include <docbookgen.h>

+ 类 DocbookCodeGenerator 继承关系图:
+ DocbookCodeGenerator 的协作图:

Public 成员函数

 DocbookCodeGenerator (TextStream &t)
 
virtual ~DocbookCodeGenerator ()
 
void setRelativePath (const QCString &path)
 
void setSourceFileName (const QCString &sourceFileName)
 
QCString sourceFileName ()
 
void codify (const QCString &text)
 
void writeCodeLink (CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)
 
void writeCodeLinkLine (CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip, bool)
 
void writeTooltip (const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &)
 
void startCodeLine (bool)
 
void endCodeLine ()
 
void startFontClass (const QCString &colorClass)
 
void endFontClass ()
 
void writeCodeAnchor (const QCString &)
 
void writeLineNumber (const QCString &extRef, const QCString &compId, const QCString &anchorId, int l, bool writeLineAnchor)
 
void setCurrentDoc (const Definition *, const QCString &, bool)
 
void addWord (const QCString &, bool)
 
void finish ()
 
void startCodeFragment (const QCString &style)
 
void endCodeFragment (const QCString &style)
 
- Public 成员函数 继承自 CodeOutputInterface
virtual ~CodeOutputInterface ()
 
 CodeOutputInterface ()
 
 CodeOutputInterface (const CodeOutputInterface &)=delete
 
CodeOutputInterfaceoperator= (const CodeOutputInterface &)=delete
 
virtual int id () const
 Identifier for the output file 更多...
 

Private 属性

TextStreamm_t
 
QCString m_refId
 
QCString m_external
 
int m_lineNumber = -1
 
int m_col = 0
 
bool m_insideCodeLine = false
 
bool m_insideSpecialHL = false
 
QCString m_relPath
 
QCString m_sourceFileName
 

详细描述

在文件 docbookgen.h23 行定义.

构造及析构函数说明

◆ DocbookCodeGenerator()

DocbookCodeGenerator::DocbookCodeGenerator ( TextStream t)

在文件 docbookgen.cpp146 行定义.

146  : m_t(t)
147 {
148 }

◆ ~DocbookCodeGenerator()

DocbookCodeGenerator::~DocbookCodeGenerator ( )
virtual

在文件 docbookgen.cpp150 行定义.

150 {}

成员函数说明

◆ addWord()

void DocbookCodeGenerator::addWord ( const QCString ,
bool   
)
virtual

实现了 CodeOutputInterface.

在文件 docbookgen.cpp260 行定义.

261 {
262 }

◆ codify()

void DocbookCodeGenerator::codify ( const QCString s)
virtual

Writes an code fragment to the output. This function should keep spaces visible, should break lines at a newline and should convert tabs to the right number of spaces.

实现了 CodeOutputInterface.

在文件 docbookgen.cpp152 行定义.

153 {
154  Docbook_DB(("(codify \"%s\")\n",text));
156 }

引用了 Docbook_DB, m_col, m_t , 以及 writeDocbookCodeString().

被这些函数引用 DocbookGenerator::codify() , 以及 writeLineNumber().

◆ endCodeFragment()

void DocbookCodeGenerator::endCodeFragment ( const QCString style)
virtual

Ends a block of code

实现了 CodeOutputInterface.

在文件 docbookgen.cpp275 行定义.

276 {
277 DB_GEN_C1(m_t)
278  //endCodeLine checks is there is still an open code line, if so closes it.
279  endCodeLine();
280 
281  m_t << "</programlisting>";
282 }

引用了 DB_GEN_C1, endCodeLine() , 以及 m_t.

被这些函数引用 DocbookGenerator::endCodeFragment().

◆ endCodeLine()

void DocbookCodeGenerator::endCodeLine ( )
virtual

Ends a line of code started with startCodeLine()

实现了 CodeOutputInterface.

在文件 docbookgen.cpp196 行定义.

197 {
198  if (m_insideCodeLine) m_t << "\n";
199  Docbook_DB(("(endCodeLine)\n"));
200  m_lineNumber = -1;
201  m_refId.resize(0);
202  m_external.resize(0);
204 }

引用了 Docbook_DB, FALSE, m_external, m_insideCodeLine, m_lineNumber, m_refId, m_t , 以及 QCString::resize().

被这些函数引用 endCodeFragment(), DocbookGenerator::endCodeLine() , 以及 finish().

◆ endFontClass()

void DocbookCodeGenerator::endFontClass ( )
virtual

Ends a block started with startFontClass()

实现了 CodeOutputInterface.

在文件 docbookgen.cpp213 行定义.

214 {
215  Docbook_DB(("(endFontClass)\n"));
216  m_t << "</emphasis>"; // non DocBook
218 }

引用了 Docbook_DB, FALSE, m_insideSpecialHL , 以及 m_t.

被这些函数引用 DocbookGenerator::endFontClass().

◆ finish()

void DocbookCodeGenerator::finish ( )

在文件 docbookgen.cpp264 行定义.

265 {
266  endCodeLine();
267 }

引用了 endCodeLine().

◆ setCurrentDoc()

void DocbookCodeGenerator::setCurrentDoc ( const Definition ,
const QCString ,
bool   
)
virtual

实现了 CodeOutputInterface.

在文件 docbookgen.cpp256 行定义.

257 {
258 }

◆ setRelativePath()

void DocbookCodeGenerator::setRelativePath ( const QCString path)
inline

在文件 docbookgen.h40 行定义.

57 :
58  TextStream &m_t;

被这些函数引用 DocbookGenerator::startFile().

◆ setSourceFileName()

void DocbookCodeGenerator::setSourceFileName ( const QCString sourceFileName)
inline

在文件 docbookgen.h41 行定义.

57 :
58  TextStream &m_t;

被这些函数引用 DocbookGenerator::endFile() , 以及 DocbookGenerator::startFile().

◆ sourceFileName()

QCString DocbookCodeGenerator::sourceFileName ( )
inline

在文件 docbookgen.h42 行定义.

57 :
58  TextStream &m_t;

被这些函数引用 DocbookGenerator::endFile().

◆ startCodeFragment()

void DocbookCodeGenerator::startCodeFragment ( const QCString style)
virtual

Starts a source code fragment. The fragment will be fed to the code parser (see code.h) for syntax highlighting and cross-referencing. The fragment ends by a call to endCodeFragment()

参数
styleThe kind of code fragment.

实现了 CodeOutputInterface.

在文件 docbookgen.cpp269 行定义.

270 {
271 DB_GEN_C1(m_t)
272  m_t << "<programlisting linenumbering=\"unnumbered\">";
273 }

引用了 DB_GEN_C1 , 以及 m_t.

被这些函数引用 DocbookGenerator::startCodeFragment().

◆ startCodeLine()

void DocbookCodeGenerator::startCodeLine ( bool  )
virtual

实现了 CodeOutputInterface.

在文件 docbookgen.cpp189 行定义.

190 {
191  Docbook_DB(("(startCodeLine)\n"));
193  m_col=0;
194 }

引用了 Docbook_DB, m_col, m_insideCodeLine , 以及 TRUE.

被这些函数引用 DocbookGenerator::startCodeLine().

◆ startFontClass()

void DocbookCodeGenerator::startFontClass ( const QCString clsName)
virtual

Starts a block with a certain meaning. Used for syntax highlighting, which elements of the same type are rendered using the same 'font class'.

参数
clsNameThe category name.

实现了 CodeOutputInterface.

在文件 docbookgen.cpp206 行定义.

207 {
208  Docbook_DB(("(startFontClass)\n"));
209  m_t << "<emphasis role=\"" << colorClass << "\">";
211 }

引用了 Docbook_DB, m_insideSpecialHL, m_t , 以及 TRUE.

被这些函数引用 DocbookGenerator::startFontClass().

◆ writeCodeAnchor()

void DocbookCodeGenerator::writeCodeAnchor ( const QCString name)
virtual

Write an anchor to a source listing.

参数
nameThe name of the anchor.

实现了 CodeOutputInterface.

在文件 docbookgen.cpp220 行定义.

221 {
222  Docbook_DB(("(writeCodeAnchor)\n"));
223 }

引用了 Docbook_DB.

被这些函数引用 DocbookGenerator::writeCodeAnchor().

◆ writeCodeLink()

void DocbookCodeGenerator::writeCodeLink ( CodeSymbolType  type,
const QCString ref,
const QCString file,
const QCString anchor,
const QCString name,
const QCString tooltip 
)
virtual

Writes a link to an object in a code fragment.

参数
typeThe type of symbol, used for semantic syntax highlighting, may be Default is no info is available.
refIf this is non-zero, the object is to be found in an external documentation file.
fileThe file in which the object is located.
anchorThe anchor uniquely identifying the object within the file.
nameThe text to display as a placeholder for the link.
tooltipThe tooltip to display when the mouse is on the link.

实现了 CodeOutputInterface.

在文件 docbookgen.cpp158 行定义.

162 {
163  Docbook_DB(("(writeCodeLink)\n"));
164  writeDocbookLink(m_t,ref,file,anchor,name,tooltip);
165  m_col+=name.length();
166 }

引用了 Docbook_DB, QCString::length(), m_col, m_t , 以及 writeDocbookLink().

被这些函数引用 DocbookGenerator::writeCodeLink() , 以及 writeLineNumber().

◆ writeCodeLinkLine()

void DocbookCodeGenerator::writeCodeLinkLine ( CodeSymbolType  type,
const QCString ref,
const QCString file,
const QCString anchor,
const QCString name,
const QCString tooltip,
bool  writeLineAnchor 
)

在文件 docbookgen.cpp168 行定义.

172 {
173  Docbook_DB(("(writeCodeLinkLine)\n"));
174  if (!writeLineAnchor) return;
175  m_t << "<anchor xml:id=\"_" << stripExtensionGeneral(stripPath(file),".xml");
176  m_t << "_1l";
177  writeDocbookString(m_t,name);
178  m_t << "\"/>";
179  m_col+=name.length();
180 }

引用了 Docbook_DB, QCString::length(), m_col, m_t, stripExtensionGeneral(), stripPath() , 以及 writeDocbookString().

被这些函数引用 writeLineNumber().

◆ writeLineNumber()

void DocbookCodeGenerator::writeLineNumber ( const QCString ref,
const QCString file,
const QCString anchor,
int  lineNumber,
bool  writeLineAnchor 
)
virtual

Writes the line number of a source listing

参数
refExternal reference (when imported from a tag file)
fileThe file part of the URL pointing to the docs.
anchorThe anchor part of the URL pointing to the docs.
lineNumberThe line number to write
writeLineAnchorIndicates if an anchor for the line number needs to be written

实现了 CodeOutputInterface.

在文件 docbookgen.cpp225 行定义.

227 {
228  Docbook_DB(("(writeLineNumber)\n"));
230  if (Config_getBool(SOURCE_BROWSER))
231  {
232  QCString lineNumber;
233  lineNumber.sprintf("%05d",l);
234 
235  if (!m_sourceFileName.isEmpty())
236  {
237  writeCodeLinkLine(CodeSymbolType::Default,ref,m_sourceFileName,anchor,lineNumber,QCString(),writeLineAnchor);
238  }
239  if (!fileName.isEmpty())
240  {
241  writeCodeLink(CodeSymbolType::Default,ref,fileName,anchor,lineNumber,QCString());
242  }
243  else
244  {
245  codify(lineNumber);
246  }
247  m_t << " ";
248  }
249  else
250  {
251  m_t << l << " ";
252  }
253  m_col=0;
254 }

引用了 codify(), Config_getBool, Default, Docbook_DB, QCString::isEmpty(), m_col, m_insideCodeLine, m_sourceFileName, m_t, QCString::sprintf(), TRUE, writeCodeLink() , 以及 writeCodeLinkLine().

被这些函数引用 DocbookGenerator::writeLineNumber().

◆ writeTooltip()

void DocbookCodeGenerator::writeTooltip ( const QCString id,
const DocLinkInfo docInfo,
const QCString decl,
const QCString desc,
const SourceLinkInfo defInfo,
const SourceLinkInfo declInfo 
)
virtual

Writes a tool tip definition

参数
idunique identifier for the tooltip
docInfoInfo about the symbol's documentation.
declfull declaration of the symbol (for functions)
descbrief description for the symbol
defInfoInfo about the symbol's definition in the source code
declInfoInfo about the symbol's declaration in the source code

实现了 CodeOutputInterface.

在文件 docbookgen.cpp182 行定义.

185 {
186  Docbook_DB(("(writeToolTip)\n"));
187 }

引用了 Docbook_DB.

被这些函数引用 DocbookGenerator::writeTooltip().

类成员变量说明

◆ m_col

int DocbookCodeGenerator::m_col = 0
private

在文件 docbookgen.h74 行定义.

被这些函数引用 codify(), startCodeLine(), writeCodeLink(), writeCodeLinkLine() , 以及 writeLineNumber().

◆ m_external

QCString DocbookCodeGenerator::m_external
private

在文件 docbookgen.h72 行定义.

被这些函数引用 endCodeLine().

◆ m_insideCodeLine

bool DocbookCodeGenerator::m_insideCodeLine = false
private

在文件 docbookgen.h75 行定义.

被这些函数引用 endCodeLine(), startCodeLine() , 以及 writeLineNumber().

◆ m_insideSpecialHL

bool DocbookCodeGenerator::m_insideSpecialHL = false
private

在文件 docbookgen.h76 行定义.

被这些函数引用 endFontClass() , 以及 startFontClass().

◆ m_lineNumber

int DocbookCodeGenerator::m_lineNumber = -1
private

在文件 docbookgen.h73 行定义.

被这些函数引用 endCodeLine().

◆ m_refId

QCString DocbookCodeGenerator::m_refId
private

在文件 docbookgen.h71 行定义.

被这些函数引用 endCodeLine().

◆ m_relPath

QCString DocbookCodeGenerator::m_relPath
private

在文件 docbookgen.h77 行定义.

◆ m_sourceFileName

QCString DocbookCodeGenerator::m_sourceFileName
private

在文件 docbookgen.h78 行定义.

被这些函数引用 writeLineNumber().

◆ m_t

TextStream& DocbookCodeGenerator::m_t
private

该类的文档由以下文件生成:
DocbookCodeGenerator::m_insideSpecialHL
bool m_insideSpecialHL
Definition: docbookgen.h:76
DocbookCodeGenerator::m_col
int m_col
Definition: docbookgen.h:74
stripExtensionGeneral
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
Definition: util.cpp:5285
DocbookCodeGenerator::m_lineNumber
int m_lineNumber
Definition: docbookgen.h:73
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
writeDocbookCodeString
void writeDocbookCodeString(TextStream &t, const QCString &str, int &col)
Definition: docbookgen.cpp:80
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocbookCodeGenerator::m_t
TextStream & m_t
Definition: docbookgen.h:70
DocbookCodeGenerator::writeCodeLinkLine
void writeCodeLinkLine(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip, bool)
Definition: docbookgen.cpp:168
writeDocbookString
void writeDocbookString(TextStream &t, const QCString &s)
Definition: docbookgen.cpp:75
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
Docbook_DB
#define Docbook_DB(x)
Definition: docbookgen.cpp:55
DocbookCodeGenerator::writeCodeLink
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)
Definition: docbookgen.cpp:158
DocbookCodeGenerator::m_external
QCString m_external
Definition: docbookgen.h:72
stripPath
QCString stripPath(const QCString &s)
Definition: util.cpp:5318
DocbookCodeGenerator::m_insideCodeLine
bool m_insideCodeLine
Definition: docbookgen.h:75
writeDocbookLink
void writeDocbookLink(TextStream &t, const QCString &, const QCString &compoundId, const QCString &anchorId, const QCString &text, const QCString &)
Definition: docbookgen.cpp:135
TRUE
#define TRUE
Definition: qcstring.h:36
DocbookCodeGenerator::codify
void codify(const QCString &text)
Definition: docbookgen.cpp:152
DocbookCodeGenerator::m_sourceFileName
QCString m_sourceFileName
Definition: docbookgen.h:78
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DocbookCodeGenerator::m_refId
QCString m_refId
Definition: docbookgen.h:71
CodeSymbolType::Default
@ Default
DB_GEN_C1
#define DB_GEN_C1(x)
Definition: docbookgen.cpp:68
DocbookCodeGenerator::endCodeLine
void endCodeLine()
Definition: docbookgen.cpp:196
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
QCString::sprintf
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:24
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108