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

Node representing an entry in the index. More...

#include <src/docnode.h>

+ Inheritance diagram for DocIndexEntry:
+ Collaboration diagram for DocIndexEntry:

Public Member Functions

 DocIndexEntry (DocParser *parser, DocNodeVariant *parent, const Definition *scope, const MemberDef *md)
 
Token parse ()
 
const Definitionscope () const
 
const MemberDefmember () const
 
QCString entry () 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_entry
 
const Definitionm_scope = nullptr
 
const MemberDefm_member = nullptr
 

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 entry in the index.

Definition at line 546 of file docnode.h.

Constructor & Destructor Documentation

◆ DocIndexEntry()

DocIndexEntry::DocIndexEntry ( DocParser * parser,
DocNodeVariant * parent,
const Definition * scope,
const MemberDef * md )
inline

Definition at line 549 of file docnode.h.

const MemberDef * m_member
Definition docnode.h:559
const Definition * m_scope
Definition docnode.h:558
const Definition * scope() const
Definition docnode.h:552
DocNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:84
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References DocNode::DocNode(), m_member, m_scope, DocNode::parent(), DocNode::parser(), and scope().

Member Function Documentation

◆ entry()

◆ member()

const MemberDef * DocIndexEntry::member ( ) const
inline

Definition at line 553 of file docnode.h.

553{ return m_member; }

References m_member.

Referenced by HtmlDocVisitor::operator()().

◆ parse()

Token DocIndexEntry::parse ( )

Definition at line 1569 of file docnode.cpp.

1570{
1571 AUTO_TRACE();
1572 Token retval(TokenRetval::RetVal_OK);
1573 auto ns = AutoNodeStack(parser(),thisVariant());
1574 Token tok=parser()->tokenizer.lex();
1575 if (!tok.is(TokenRetval::TK_WHITESPACE))
1576 {
1577 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\addindex command");
1578 goto endindexentry;
1579 }
1581 m_entry="";
1582 tok = parser()->tokenizer.lex();
1583 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
1584 {
1585 switch (tok.value())
1586 {
1587 case TokenRetval::TK_WHITESPACE:
1588 m_entry+=" ";
1589 break;
1590 case TokenRetval::TK_WORD:
1591 case TokenRetval::TK_LNKWORD:
1593 break;
1594 case TokenRetval::TK_SYMBOL:
1595 {
1596 HtmlEntityMapper::SymType s = DocSymbol::decodeSymbol(parser()->context.token->name);
1597 switch (s)
1598 {
1599 case HtmlEntityMapper::Sym_BSlash: m_entry+='\\'; break;
1600 case HtmlEntityMapper::Sym_At: m_entry+='@'; break;
1601 case HtmlEntityMapper::Sym_Less: m_entry+='<'; break;
1602 case HtmlEntityMapper::Sym_Greater: m_entry+='>'; break;
1603 case HtmlEntityMapper::Sym_Amp: m_entry+='&'; break;
1604 case HtmlEntityMapper::Sym_Dollar: m_entry+='$'; break;
1605 case HtmlEntityMapper::Sym_Hash: m_entry+='#'; break;
1606 case HtmlEntityMapper::Sym_Percent: m_entry+='%'; break;
1607 case HtmlEntityMapper::Sym_apos: m_entry+='\''; break;
1608 case HtmlEntityMapper::Sym_Quot: m_entry+='"'; break;
1609 case HtmlEntityMapper::Sym_lsquo: m_entry+='`'; break;
1610 case HtmlEntityMapper::Sym_rsquo: m_entry+='\''; break;
1611 case HtmlEntityMapper::Sym_ldquo: m_entry+="``"; break;
1612 case HtmlEntityMapper::Sym_rdquo: m_entry+="''"; break;
1613 case HtmlEntityMapper::Sym_ndash: m_entry+="--"; break;
1614 case HtmlEntityMapper::Sym_mdash: m_entry+="---"; break;
1615 default:
1616 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected symbol '{}' found as argument of \\addindex",parser()->context.token->name);
1617 break;
1618 }
1619 }
1620 break;
1621 case TokenRetval::TK_COMMAND_AT:
1622 // fall through
1623 case TokenRetval::TK_COMMAND_BS:
1624 switch (Mappers::cmdMapper->map(parser()->context.token->name))
1625 {
1626 case CommandType::CMD_BSLASH: m_entry+='\\'; break;
1627 case CommandType::CMD_AT: m_entry+='@'; break;
1628 case CommandType::CMD_LESS: m_entry+='<'; break;
1629 case CommandType::CMD_GREATER: m_entry+='>'; break;
1630 case CommandType::CMD_AMP: m_entry+='&'; break;
1631 case CommandType::CMD_DOLLAR: m_entry+='$'; break;
1632 case CommandType::CMD_HASH: m_entry+='#'; break;
1633 case CommandType::CMD_DCOLON: m_entry+="::"; break;
1634 case CommandType::CMD_PERCENT: m_entry+='%'; break;
1635 case CommandType::CMD_NDASH: m_entry+="--"; break;
1636 case CommandType::CMD_MDASH: m_entry+="---"; break;
1637 case CommandType::CMD_QUOTE: m_entry+='"'; break;
1638 case CommandType::CMD_PUNT: m_entry+='.'; break;
1639 case CommandType::CMD_PLUS: m_entry+='+'; break;
1640 case CommandType::CMD_MINUS: m_entry+='-'; break;
1641 case CommandType::CMD_EQUAL: m_entry+='='; break;
1642 case CommandType::CMD_EXCLAMATION: m_entry+='!'; break;
1643 case CommandType::CMD_QUESTION: m_entry+='?'; break;
1644 default:
1645 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected command {} found as argument of \\addindex",
1646 parser()->context.token->name);
1647 break;
1648 }
1649 break;
1650 default:
1651 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected token {}",
1652 tok.to_string());
1653 break;
1654 }
1655 tok = parser()->tokenizer.lex();
1656 }
1658 m_entry = m_entry.stripWhiteSpace();
1659endindexentry:
1660 AUTO_TRACE_EXIT("retval={}",retval.to_string());
1661 return retval;
1662}
DocNodeVariant * thisVariant()
Definition docnode.h:92
DocTokenizer tokenizer
DocParserContext context
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
Definition docnode.cpp:152
void setStateTitle()
void setStatePara()
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
const Mapper< CommandType > * cmdMapper
TokenInfo * token
Definition docparser_p.h:92
QCString name

References AUTO_TRACE, AUTO_TRACE_EXIT, CMD_AMP, CMD_AT, CMD_BSLASH, CMD_DCOLON, CMD_DOLLAR, CMD_EQUAL, CMD_EXCLAMATION, CMD_GREATER, CMD_HASH, CMD_LESS, CMD_MDASH, CMD_MINUS, CMD_NDASH, CMD_PERCENT, CMD_PLUS, CMD_PUNT, CMD_QUESTION, CMD_QUOTE, Mappers::cmdMapper, DocParser::context, DocSymbol::decodeSymbol(), Token::is(), Token::is_any_of(), DocTokenizer::lex(), m_entry, TokenInfo::name, DocNode::parser(), DocTokenizer::setStatePara(), DocTokenizer::setStateTitle(), HtmlEntityMapper::Sym_Amp, HtmlEntityMapper::Sym_apos, HtmlEntityMapper::Sym_At, HtmlEntityMapper::Sym_BSlash, HtmlEntityMapper::Sym_Dollar, HtmlEntityMapper::Sym_Greater, HtmlEntityMapper::Sym_Hash, HtmlEntityMapper::Sym_ldquo, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_lsquo, HtmlEntityMapper::Sym_mdash, HtmlEntityMapper::Sym_ndash, HtmlEntityMapper::Sym_Percent, HtmlEntityMapper::Sym_Quot, HtmlEntityMapper::Sym_rdquo, HtmlEntityMapper::Sym_rsquo, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, Token::value(), and warn_doc_error.

◆ scope()

const Definition * DocIndexEntry::scope ( ) const
inline

Definition at line 552 of file docnode.h.

552{ return m_scope; }

References m_scope.

Referenced by DocIndexEntry(), and HtmlDocVisitor::operator()().

Member Data Documentation

◆ m_entry

QCString DocIndexEntry::m_entry
private

Definition at line 557 of file docnode.h.

Referenced by entry(), and parse().

◆ m_member

const MemberDef* DocIndexEntry::m_member = nullptr
private

Definition at line 559 of file docnode.h.

Referenced by DocIndexEntry(), and member().

◆ m_scope

const Definition* DocIndexEntry::m_scope = nullptr
private

Definition at line 558 of file docnode.h.

Referenced by DocIndexEntry(), and scope().


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