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.

virtual DocbookCodeGenerator::~DocbookCodeGenerator ( )
inlinevirtual

Definition at line 183 of file docbookgen.cpp.

183 {}

Member Function Documentation

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

Implements CodeOutputInterface.

Definition at line 264 of file docbookgen.cpp.

265  {
266  }
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.

186  {
187  Docbook_DB(("(codify \"%s\")\n",text));
189  }
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
void writeDocbookCodeString(FTextStream &t, const char *s, int &col)
Definition: docbookgen.cpp:110
FTextStream & m_t
Definition: docbookgen.cpp:273
void DocbookCodeGenerator::endCodeLine ( )
inlinevirtual

Ends a line of code started with startCodeLine()

Implements CodeOutputInterface.

Definition at line 222 of file docbookgen.cpp.

223  {
224  m_t << endl;
225  Docbook_DB(("(endCodeLine)\n"));
226  m_lineNumber = -1;
227  m_refId.resize(0);
228  m_external.resize(0);
230  }
bool resize(uint newlen)
Definition: qcstring.h:225
const bool FALSE
Definition: qglobal.h:370
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
FTextStream & m_t
Definition: docbookgen.cpp:273
QTextStream & endl(QTextStream &s)
void DocbookCodeGenerator::endFontClass ( )
inlinevirtual

Ends a block started with startFontClass()

Implements CodeOutputInterface.

Definition at line 237 of file docbookgen.cpp.

238  {
239  Docbook_DB(("(endFontClass)\n"));
240  m_t << "</emphasis>"; // non DocBook
242  }
const bool FALSE
Definition: qglobal.h:370
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
FTextStream & m_t
Definition: docbookgen.cpp:273
void DocbookCodeGenerator::finish ( )
inline

Definition at line 267 of file docbookgen.cpp.

268  {
270  }
void DocbookCodeGenerator::setCurrentDoc ( Definition ,
const char *  ,
bool   
)
inlinevirtual

Implements CodeOutputInterface.

Definition at line 261 of file docbookgen.cpp.

262  {
263  }
void DocbookCodeGenerator::startCodeLine ( bool  )
inlinevirtual

Implements CodeOutputInterface.

Definition at line 204 of file docbookgen.cpp.

205  {
206  Docbook_DB(("(startCodeLine)\n"));
207  if (m_lineNumber!=-1)
208  {
209  if (!m_refId.isEmpty())
210  {
211  m_t << "<link linkend=\"" << m_refId << "\">";
212  }
213  m_t << m_lineNumber << " ";
214  if (!m_refId.isEmpty())
215  {
216  m_t << "</link>";
217  }
218  }
220  m_col=0;
221  }
bool isEmpty() const
Definition: qcstring.h:189
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
FTextStream & m_t
Definition: docbookgen.cpp:273
const bool TRUE
Definition: qglobal.h:371
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.

232  {
233  Docbook_DB(("(startFontClass)\n"));
234  m_t << "<emphasis class=\"" << colorClass << "\">";
236  }
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
FTextStream & m_t
Definition: docbookgen.cpp:273
const bool TRUE
Definition: qglobal.h:371
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.

244  {
245  Docbook_DB(("(writeCodeAnchor)\n"));
246  }
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
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.

193  {
194  Docbook_DB(("(writeCodeLink)\n"));
195  writeDocbookLink(m_t,ref,file,anchor,name,tooltip);
196  m_col+=strlen(name);
197  }
void writeDocbookLink(FTextStream &t, const char *, const char *compoundId, const char *anchorId, const char *text, const char *)
Definition: docbookgen.cpp:148
static QCString name
Definition: declinfo.cpp:673
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
FTextStream & m_t
Definition: docbookgen.cpp:273
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.

249  {
250  Docbook_DB(("(writeLineNumber)\n"));
251  // we remember the information provided here to use it
252  // at the <codeline> start tag.
253  m_lineNumber = l;
254  if (compId)
255  {
256  m_refId=compId;
257  if (anchorId) m_refId+=(QCString)"_1"+anchorId;
258  if (extRef) m_external=extRef;
259  }
260  }
static QStrList * l
Definition: config.cpp:1044
#define Docbook_DB(x)
Definition: docbookgen.cpp:51
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.

201  {
202  Docbook_DB(("(writeToolTip)\n"));
203  }
#define Docbook_DB(x)
Definition: docbookgen.cpp:51

Member Data Documentation

int DocbookCodeGenerator::m_col
private

Definition at line 277 of file docbookgen.cpp.

QCString DocbookCodeGenerator::m_external
private

Definition at line 275 of file docbookgen.cpp.

bool DocbookCodeGenerator::m_insideCodeLine
private

Definition at line 278 of file docbookgen.cpp.

bool DocbookCodeGenerator::m_insideSpecialHL
private

Definition at line 279 of file docbookgen.cpp.

int DocbookCodeGenerator::m_lineNumber
private

Definition at line 276 of file docbookgen.cpp.

QCString DocbookCodeGenerator::m_refId
private

Definition at line 274 of file docbookgen.cpp.

FTextStream& DocbookCodeGenerator::m_t
private

Definition at line 273 of file docbookgen.cpp.


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