Doxygen
Loading...
Searching...
No Matches
DocFormula Class Reference

Node representing an item of a cross-referenced list. More...

#include <src/docnode.h>

+ Inheritance diagram for DocFormula:
+ Collaboration diagram for DocFormula:

Public Member Functions

 DocFormula (DocParser *parser, DocNodeVariant *parent, int id)
 
QCString name () const
 
QCString text () const
 
QCString relPath () const
 
int id () const
 
bool isInline () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_name
 
QCString m_text
 
QCString m_relPath
 
int m_id = 0
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing an item of a cross-referenced list.

Definition at line 509 of file docnode.h.

Constructor & Destructor Documentation

◆ DocFormula()

DocFormula::DocFormula ( DocParser * parser,
DocNodeVariant * parent,
int id )

Definition at line 514 of file docnode.cpp.

515 m_relPath(parser->context.relPath)
516{
517 const Formula *formula = FormulaManager::instance().findFormula(id);
518 if (formula && !formula->text().isEmpty())
519 {
520 m_id = id;
521 m_name.sprintf("form_%d",m_id);
522 m_text = formula->text();
523 }
524 else // wrong \_form#<n> command
525 {
526 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"Wrong formula id %d",id);
527 m_id = -1;
528 }
529}
QCString m_relPath
Definition docnode.h:527
QCString m_text
Definition docnode.h:526
int id() const
Definition docnode.h:516
QCString m_name
Definition docnode.h:525
DocNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:84
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89
QCString text() const
Definition formula.h:37
const Formula * findFormula(int formulaId) const
Definition formula.cpp:705
static FormulaManager & instance()
Definition formula.cpp:54
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74

References DocNode::DocNode(), FormulaManager::findFormula(), id(), FormulaManager::instance(), QCString::isEmpty(), m_id, m_name, m_relPath, m_text, DocNode::parent(), DocNode::parser(), relPath(), Formula::text(), and warn_doc_error.

Member Function Documentation

◆ id()

int DocFormula::id ( ) const
inline

Definition at line 516 of file docnode.h.

516{ return m_id; }

References m_id.

Referenced by DocFormula(), HtmlDocVisitor::operator()(), PerlModDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ isInline()

bool DocFormula::isInline ( ) const
inline

Definition at line 517 of file docnode.h.

518 {
519 if (m_text.length()>1 && m_text.at(0)=='\\' && m_text.at(1)=='[') return false;
520 if (m_text.startsWith("\\begin{")) return false;
521 return true;
522 }

References m_text.

Referenced by mustBeOutsideParagraph(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), and RTFDocVisitor::operator()().

◆ name()

QCString DocFormula::name ( ) const
inline

◆ relPath()

QCString DocFormula::relPath ( ) const
inline

Definition at line 515 of file docnode.h.

515{ return m_relPath; }

References m_relPath.

Referenced by DocFormula(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), and RTFDocVisitor::operator()().

◆ text()

Member Data Documentation

◆ m_id

int DocFormula::m_id = 0
private

Definition at line 528 of file docnode.h.

Referenced by DocFormula(), and id().

◆ m_name

QCString DocFormula::m_name
private

Definition at line 525 of file docnode.h.

Referenced by DocFormula(), and name().

◆ m_relPath

QCString DocFormula::m_relPath
private

Definition at line 527 of file docnode.h.

Referenced by DocFormula(), and relPath().

◆ m_text

QCString DocFormula::m_text
private

Definition at line 526 of file docnode.h.

Referenced by DocFormula(), isInline(), and text().


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