My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
DocbookCodeGenerator Class Reference
Inheritance diagram for DocbookCodeGenerator:
CodeOutputInterface

Public Member Functions

 DocbookCodeGenerator (FTextStream &t)
 
virtual ~DocbookCodeGenerator ()
 
void codify (const char *text)
 
void writeCodeLink (const char *ref, const char *file, const char *anchor, const char *name, const char *tooltip)
 
void writeTooltip (const char *, const DocLinkInfo &, const char *, const char *, const SourceLinkInfo &, const SourceLinkInfo &)
 
void startCodeLine (bool)
 
void endCodeLine ()
 
void startFontClass (const char *colorClass)
 
void endFontClass ()
 
void writeCodeAnchor (const char *)
 
void writeLineNumber (const char *extRef, const char *compId, const char *anchorId, int l)
 
void setCurrentDoc (Definition *, const char *, bool)
 
void addWord (const char *, bool)
 
void finish ()
 
- Public Member Functions inherited from CodeOutputInterface
virtual ~CodeOutputInterface ()
 

Private Attributes

FTextStreamm_t
 
QCString m_refId
 
QCString m_external
 
int m_lineNumber
 
int m_col
 
bool m_insideCodeLine
 
bool m_insideSpecialHL
 

Detailed Description

Definition at line 178 of file docbookgen.cpp.

Constructor & Destructor Documentation

DocbookCodeGenerator::DocbookCodeGenerator ( FTextStream t)
inline

Definition at line 181 of file docbookgen.cpp.

: m_t(t), m_lineNumber(-1), m_col(0),
virtual DocbookCodeGenerator::~DocbookCodeGenerator ( )
inlinevirtual

Definition at line 183 of file docbookgen.cpp.

{}

Member Function Documentation

void DocbookCodeGenerator::addWord ( const char *  ,
bool   
)
inlinevirtual

Implements CodeOutputInterface.

Definition at line 264 of file docbookgen.cpp.

{
}
void DocbookCodeGenerator::codify ( const char *  s)
inlinevirtual

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.

Implements CodeOutputInterface.

Definition at line 185 of file docbookgen.cpp.

References Docbook_DB, m_col, m_t, and writeDocbookCodeString().

{
Docbook_DB(("(codify \"%s\")\n",text));
}
void DocbookCodeGenerator::endCodeLine ( )
inlinevirtual

Ends a line of code started with startCodeLine()

Implements CodeOutputInterface.

Definition at line 222 of file docbookgen.cpp.

References Docbook_DB, endl(), m_external, m_insideCodeLine, m_lineNumber, m_refId, and m_t.

Referenced by finish().

{
m_t << endl;
Docbook_DB(("(endCodeLine)\n"));
m_refId.resize(0);
m_external.resize(0);
}
void DocbookCodeGenerator::endFontClass ( )
inlinevirtual

Ends a block started with startFontClass()

Implements CodeOutputInterface.

Definition at line 237 of file docbookgen.cpp.

References Docbook_DB, m_insideSpecialHL, and m_t.

{
Docbook_DB(("(endFontClass)\n"));
m_t << "</emphasis>"; // non DocBook
}
void DocbookCodeGenerator::finish ( )
inline

Definition at line 267 of file docbookgen.cpp.

References endCodeLine(), and m_insideCodeLine.

Referenced by writeDocbookCodeBlock().

void DocbookCodeGenerator::setCurrentDoc ( Definition ,
const char *  ,
bool   
)
inlinevirtual

Implements CodeOutputInterface.

Definition at line 261 of file docbookgen.cpp.

{
}
void DocbookCodeGenerator::startCodeLine ( bool  )
inlinevirtual

Implements CodeOutputInterface.

Definition at line 204 of file docbookgen.cpp.

References Docbook_DB, m_col, m_insideCodeLine, m_lineNumber, m_refId, and m_t.

{
Docbook_DB(("(startCodeLine)\n"));
if (m_lineNumber!=-1)
{
if (!m_refId.isEmpty())
{
m_t << "<link linkend=\"" << m_refId << "\">";
}
m_t << m_lineNumber << " ";
if (!m_refId.isEmpty())
{
m_t << "</link>";
}
}
m_col=0;
}
void DocbookCodeGenerator::startFontClass ( const char *  clsName)
inlinevirtual

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

Parameters
clsNameThe category name.

Implements CodeOutputInterface.

Definition at line 231 of file docbookgen.cpp.

References Docbook_DB, m_insideSpecialHL, and m_t.

{
Docbook_DB(("(startFontClass)\n"));
m_t << "<emphasis class=\"" << colorClass << "\">";
}
void DocbookCodeGenerator::writeCodeAnchor ( const char *  name)
inlinevirtual

Write an anchor to a source listing.

Parameters
nameThe name of the anchor.

Implements CodeOutputInterface.

Definition at line 243 of file docbookgen.cpp.

References Docbook_DB.

{
Docbook_DB(("(writeCodeAnchor)\n"));
}
void DocbookCodeGenerator::writeCodeLink ( const char *  ref,
const char *  file,
const char *  anchor,
const char *  name,
const char *  tooltip 
)
inlinevirtual

Writes a link to an object in a code fragment.

Parameters
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.

Implements CodeOutputInterface.

Definition at line 190 of file docbookgen.cpp.

References Docbook_DB, m_col, m_t, and writeDocbookLink().

{
Docbook_DB(("(writeCodeLink)\n"));
writeDocbookLink(m_t,ref,file,anchor,name,tooltip);
m_col+=strlen(name);
}
void DocbookCodeGenerator::writeLineNumber ( const char *  ref,
const char *  file,
const char *  anchor,
int  lineNumber 
)
inlinevirtual

Writes the line number of a source listing

Parameters
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

Implements CodeOutputInterface.

Definition at line 247 of file docbookgen.cpp.

References Docbook_DB, m_external, m_lineNumber, and m_refId.

{
Docbook_DB(("(writeLineNumber)\n"));
// we remember the information provided here to use it
// at the <codeline> start tag.
if (compId)
{
m_refId=compId;
if (anchorId) m_refId+=(QCString)"_1"+anchorId;
if (extRef) m_external=extRef;
}
}
void DocbookCodeGenerator::writeTooltip ( const char *  id,
const DocLinkInfo docInfo,
const char *  decl,
const char *  desc,
const SourceLinkInfo defInfo,
const SourceLinkInfo declInfo 
)
inlinevirtual

Writes a tool tip definition

Parameters
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

Implements CodeOutputInterface.

Definition at line 198 of file docbookgen.cpp.

References Docbook_DB.

{
Docbook_DB(("(writeToolTip)\n"));
}

Member Data Documentation

int DocbookCodeGenerator::m_col
private

Definition at line 277 of file docbookgen.cpp.

Referenced by codify(), startCodeLine(), and writeCodeLink().

QCString DocbookCodeGenerator::m_external
private

Definition at line 275 of file docbookgen.cpp.

Referenced by endCodeLine(), and writeLineNumber().

bool DocbookCodeGenerator::m_insideCodeLine
private

Definition at line 278 of file docbookgen.cpp.

Referenced by endCodeLine(), finish(), and startCodeLine().

bool DocbookCodeGenerator::m_insideSpecialHL
private

Definition at line 279 of file docbookgen.cpp.

Referenced by endFontClass(), and startFontClass().

int DocbookCodeGenerator::m_lineNumber
private

Definition at line 276 of file docbookgen.cpp.

Referenced by endCodeLine(), startCodeLine(), and writeLineNumber().

QCString DocbookCodeGenerator::m_refId
private

Definition at line 274 of file docbookgen.cpp.

Referenced by endCodeLine(), startCodeLine(), and writeLineNumber().

FTextStream& DocbookCodeGenerator::m_t
private

The documentation for this class was generated from the following file: