Doxygen
Loading...
Searching...
No Matches
DocInternalRef Class Referencefinal

Node representing an internal reference to some item. More...

#include <src/docnode.h>

Inheritance diagram for DocInternalRef:
Collaboration diagram for DocInternalRef:

Public Member Functions

 DocInternalRef (DocParser *parser, DocNodeVariant *parent, const DString &target)
void parse ()
DString file () const
DString relPath () const
DString anchor () const
Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
DocNodeListchildren ()
const DocNodeListchildren () 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

DString m_file
DString m_relPath
DString m_anchor

Additional Inherited Members

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

Detailed Description

Node representing an internal reference to some item.

Definition at line 815 of file docnode.h.

Constructor & Destructor Documentation

◆ DocInternalRef()

DocInternalRef::DocInternalRef ( DocParser * parser,
DocNodeVariant * parent,
const DString & target )

Definition at line 677 of file docnode.cpp.

679{
680 size_t i=ref.find('#');
681 if (i!=DString::npos)
682 {
683 m_anchor = ref.mid(i+1);
684 m_file = ref.left(i);
685 }
686 else
687 {
688 m_file = ref;
689 }
690}
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:322
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:182
size_t find(char c, size_t pos=0) const
Definition dstring.h:243
DString left(size_t len) const
Definition dstring.h:310
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:141
DString m_anchor
Definition docnode.h:827
DString m_file
Definition docnode.h:825
DString m_relPath
Definition docnode.h:826
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89
DocParserContext context

References DocCompoundNode::DocCompoundNode(), DString::find(), DString::left(), m_anchor, m_file, m_relPath, DString::mid(), DString::npos, DocNode::parent(), DocNode::parser(), and relPath().

Member Function Documentation

◆ anchor()

◆ file()

◆ parse()

void DocInternalRef::parse ( )

Definition at line 692 of file docnode.cpp.

693{
694 AUTO_TRACE();
695 auto ns = AutoNodeStack(parser(),thisVariant());
696
697 Token tok = parser()->tokenizer.lex();
698 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
699 {
700 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
701 {
703 }
704 tok=parser()->tokenizer.lex();
705 }
706
708}
DocNodeList & children()
Definition docnode.h:143
DocNodeVariant * thisVariant()
Definition docnode.h:92
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children, size_t numberOfElementsToClose=0)
DocTokenizer tokenizer
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const DString &txt)
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:51

References AUTO_TRACE, DocCompoundNode::children(), DocParser::errorHandleDefaultToken(), DocParser::handlePendingStyleCommands(), Token::is_any_of(), DocTokenizer::lex(), DocNode::parser(), DocNode::thisVariant(), and DocParser::tokenizer.

◆ relPath()

DString DocInternalRef::relPath ( ) const
inline

Definition at line 821 of file docnode.h.

821{ return m_relPath; }

References m_relPath.

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

Member Data Documentation

◆ m_anchor

DString DocInternalRef::m_anchor
private

Definition at line 827 of file docnode.h.

Referenced by anchor(), and DocInternalRef().

◆ m_file

DString DocInternalRef::m_file
private

Definition at line 825 of file docnode.h.

Referenced by DocInternalRef(), and file().

◆ m_relPath

DString DocInternalRef::m_relPath
private

Definition at line 826 of file docnode.h.

Referenced by DocInternalRef(), and relPath().


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