Doxygen
XMLCodeGenerator类 参考

#include <xmlgen.h>

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

Public 成员函数

 XMLCodeGenerator (TextStream &t)
 
virtual ~XMLCodeGenerator ()
 
void codify (const QCString &text) override
 Generator for producing XML formatted source code. 更多...
 
void writeCodeLink (CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override
 
void writeTooltip (const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &) override
 
void startCodeLine (bool) override
 
void endCodeLine () override
 
void startFontClass (const QCString &colorClass) override
 
void endFontClass () override
 
void writeCodeAnchor (const QCString &) override
 
void writeLineNumber (const QCString &extRef, const QCString &compId, const QCString &anchorId, int l, bool writeLineAnchor) override
 
void setCurrentDoc (const Definition *, const QCString &, bool) override
 
void addWord (const QCString &, bool) override
 
void startCodeFragment (const QCString &) override
 
void endCodeFragment (const QCString &) override
 
void finish ()
 
- 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
 
bool m_isMemberRef
 
int m_col
 
bool m_insideCodeLine
 
bool m_normalHLNeedStartTag
 
bool m_insideSpecialHL
 

详细描述

在文件 xmlgen.h20 行定义.

构造及析构函数说明

◆ XMLCodeGenerator()

XMLCodeGenerator::XMLCodeGenerator ( TextStream t)

在文件 xmlgen.cpp228 行定义.

◆ ~XMLCodeGenerator()

virtual XMLCodeGenerator::~XMLCodeGenerator ( )
inlinevirtual

在文件 xmlgen.h25 行定义.

25 { }

成员函数说明

◆ addWord()

void XMLCodeGenerator::addWord ( const QCString ,
bool   
)
inlineoverridevirtual

实现了 CodeOutputInterface.

在文件 xmlgen.h43 行定义.

43 {}

◆ codify()

void XMLCodeGenerator::codify ( const QCString text)
overridevirtual

Generator for producing XML formatted source code.

实现了 CodeOutputInterface.

在文件 xmlgen.cpp234 行定义.

235 {
236  XML_DB(("(codify \"%s\")\n",text));
238  {
239  m_t << "<highlight class=\"normal\">";
241  }
243 }

引用了 FALSE, m_col, m_insideCodeLine, m_insideSpecialHL, m_normalHLNeedStartTag, m_t, writeXMLCodeString() , 以及 XML_DB.

◆ endCodeFragment()

void XMLCodeGenerator::endCodeFragment ( const QCString style)
overridevirtual

Ends a block of code

实现了 CodeOutputInterface.

在文件 xmlgen.cpp352 行定义.

353 {
354  m_t << " </programlisting>\n";
355 }

引用了 m_t.

被这些函数引用 writeXMLCodeBlock().

◆ endCodeLine()

void XMLCodeGenerator::endCodeLine ( )
overridevirtual

Ends a line of code started with startCodeLine()

实现了 CodeOutputInterface.

在文件 xmlgen.cpp292 行定义.

293 {
294  XML_DB(("(endCodeLine)\n"));
296  {
297  m_t << "</highlight>";
299  }
300  m_t << "</codeline>\n"; // non DocBook
301  m_lineNumber = -1;
302  m_refId.resize(0);
303  m_external.resize(0);
305 }

引用了 FALSE, m_external, m_insideCodeLine, m_insideSpecialHL, m_lineNumber, m_normalHLNeedStartTag, m_refId, m_t, QCString::resize(), TRUE , 以及 XML_DB.

被这些函数引用 finish().

◆ endFontClass()

void XMLCodeGenerator::endFontClass ( )
overridevirtual

Ends a block started with startFontClass()

实现了 CodeOutputInterface.

在文件 xmlgen.cpp317 行定义.

318 {
319  XML_DB(("(endFontClass)\n"));
320  m_t << "</highlight>"; // non DocBook
322 }

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

◆ finish()

void XMLCodeGenerator::finish ( )

在文件 xmlgen.cpp342 行定义.

343 {
345 }

引用了 endCodeLine() , 以及 m_insideCodeLine.

被这些函数引用 writeXMLCodeBlock().

◆ setCurrentDoc()

void XMLCodeGenerator::setCurrentDoc ( const Definition ,
const QCString ,
bool   
)
inlineoverridevirtual

实现了 CodeOutputInterface.

在文件 xmlgen.h42 行定义.

42 {}

◆ startCodeFragment()

void XMLCodeGenerator::startCodeFragment ( const QCString style)
overridevirtual

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.

在文件 xmlgen.cpp347 行定义.

348 {
349  m_t << " <programlisting>\n";
350 }

引用了 m_t.

被这些函数引用 writeXMLCodeBlock().

◆ startCodeLine()

void XMLCodeGenerator::startCodeLine ( bool  )
overridevirtual

实现了 CodeOutputInterface.

在文件 xmlgen.cpp264 行定义.

265 {
266  XML_DB(("(startCodeLine)\n"));
267  m_t << "<codeline";
268  if (m_lineNumber!=-1)
269  {
270  m_t << " lineno=\"" << m_lineNumber << "\"";
271  if (!m_refId.isEmpty())
272  {
273  m_t << " refid=\"" << m_refId << "\"";
274  if (m_isMemberRef)
275  {
276  m_t << " refkind=\"member\"";
277  }
278  else
279  {
280  m_t << " refkind=\"compound\"";
281  }
282  }
283  if (!m_external.isEmpty())
284  {
285  m_t << " external=\"" << m_external << "\"";
286  }
287  }
288  m_t << ">";
290  m_col=0;
291 }

引用了 QCString::isEmpty(), m_col, m_external, m_insideCodeLine, m_isMemberRef, m_lineNumber, m_refId, m_t, TRUE , 以及 XML_DB.

◆ startFontClass()

void XMLCodeGenerator::startFontClass ( const QCString clsName)
overridevirtual

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.

在文件 xmlgen.cpp306 行定义.

307 {
308  XML_DB(("(startFontClass)\n"));
310  {
311  m_t << "</highlight>";
313  }
314  m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook
316 }

引用了 m_insideCodeLine, m_insideSpecialHL, m_normalHLNeedStartTag, m_t, TRUE , 以及 XML_DB.

◆ writeCodeAnchor()

void XMLCodeGenerator::writeCodeAnchor ( const QCString name)
overridevirtual

Write an anchor to a source listing.

参数
nameThe name of the anchor.

实现了 CodeOutputInterface.

在文件 xmlgen.cpp323 行定义.

324 {
325  XML_DB(("(writeCodeAnchor)\n"));
326 }

引用了 XML_DB.

◆ writeCodeLink()

void XMLCodeGenerator::writeCodeLink ( CodeSymbolType  type,
const QCString ref,
const QCString file,
const QCString anchor,
const QCString name,
const QCString tooltip 
)
overridevirtual

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.

在文件 xmlgen.cpp244 行定义.

248 {
249  XML_DB(("(writeCodeLink)\n"));
251  {
252  m_t << "<highlight class=\"normal\">";
254  }
255  writeXMLLink(m_t,ref,file,anchor,name,tooltip);
256  m_col+=name.length();
257 }

引用了 FALSE, QCString::length(), m_col, m_insideCodeLine, m_insideSpecialHL, m_normalHLNeedStartTag, m_t, writeXMLLink() , 以及 XML_DB.

◆ writeLineNumber()

void XMLCodeGenerator::writeLineNumber ( const QCString ref,
const QCString file,
const QCString anchor,
int  lineNumber,
bool  writeLineAnchor 
)
overridevirtual

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.

在文件 xmlgen.cpp327 行定义.

329 {
330  XML_DB(("(writeLineNumber)\n"));
331  // we remember the information provided here to use it
332  // at the <codeline> start tag.
333  m_lineNumber = l;
334  if (!compId.isEmpty())
335  {
336  m_refId=compId;
337  if (!anchorId.isEmpty()) m_refId+=(QCString)"_1"+anchorId;
338  m_isMemberRef = anchorId!=0;
339  if (!extRef.isEmpty()) m_external=extRef;
340  }
341 }

引用了 QCString::isEmpty(), m_external, m_isMemberRef, m_lineNumber, m_refId , 以及 XML_DB.

◆ writeTooltip()

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

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.

在文件 xmlgen.cpp258 行定义.

261 {
262  XML_DB(("(writeToolTip)\n"));
263 }

引用了 XML_DB.

类成员变量说明

◆ m_col

int XMLCodeGenerator::m_col
private

在文件 xmlgen.h55 行定义.

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

◆ m_external

QCString XMLCodeGenerator::m_external
private

在文件 xmlgen.h52 行定义.

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

◆ m_insideCodeLine

bool XMLCodeGenerator::m_insideCodeLine
private

在文件 xmlgen.h57 行定义.

被这些函数引用 codify(), endCodeLine(), finish(), startCodeLine(), startFontClass() , 以及 writeCodeLink().

◆ m_insideSpecialHL

bool XMLCodeGenerator::m_insideSpecialHL
private

在文件 xmlgen.h59 行定义.

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

◆ m_isMemberRef

bool XMLCodeGenerator::m_isMemberRef
private

在文件 xmlgen.h54 行定义.

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

◆ m_lineNumber

int XMLCodeGenerator::m_lineNumber
private

在文件 xmlgen.h53 行定义.

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

◆ m_normalHLNeedStartTag

bool XMLCodeGenerator::m_normalHLNeedStartTag
private

在文件 xmlgen.h58 行定义.

被这些函数引用 codify(), endCodeLine(), startFontClass() , 以及 writeCodeLink().

◆ m_refId

QCString XMLCodeGenerator::m_refId
private

在文件 xmlgen.h51 行定义.

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

◆ m_t

TextStream& XMLCodeGenerator::m_t
private

该类的文档由以下文件生成:
writeXMLCodeString
void writeXMLCodeString(TextStream &t, const QCString &str, int &col)
Definition: xmlgen.cpp:115
XMLCodeGenerator::m_col
int m_col
Definition: xmlgen.h:55
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
XMLCodeGenerator::m_isMemberRef
bool m_isMemberRef
Definition: xmlgen.h:54
XMLCodeGenerator::endCodeLine
void endCodeLine() override
Definition: xmlgen.cpp:292
XMLCodeGenerator::m_insideSpecialHL
bool m_insideSpecialHL
Definition: xmlgen.h:59
XMLCodeGenerator::m_normalHLNeedStartTag
bool m_normalHLNeedStartTag
Definition: xmlgen.h:58
TRUE
#define TRUE
Definition: qcstring.h:36
XMLCodeGenerator::m_external
QCString m_external
Definition: xmlgen.h:52
XMLCodeGenerator::m_lineNumber
int m_lineNumber
Definition: xmlgen.h:53
XMLCodeGenerator::m_insideCodeLine
bool m_insideCodeLine
Definition: xmlgen.h:57
writeXMLLink
void writeXMLLink(TextStream &t, const QCString &extRef, const QCString &compoundId, const QCString &anchorId, const QCString &text, const QCString &tooltip)
Definition: xmlgen.cpp:191
XMLCodeGenerator::m_refId
QCString m_refId
Definition: xmlgen.h:51
XML_DB
#define XML_DB(x)
Definition: xmlgen.cpp:52
XMLCodeGenerator::m_t
TextStream & m_t
Definition: xmlgen.h:50
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
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108