MD::details::AlgoVisitor

Search for usage in LXR

MD::details::AlgoVisitor< Trait > Class Template Reference

#include <algo.h>

Inheritance diagram for MD::details::AlgoVisitor< Trait >:

Classes

struct  IncrementNestingLevel
 

Public Member Functions

 AlgoVisitor (unsigned int mnl, const typename Trait::template Vector< ItemType > &t, ItemFunctor< Trait > f)
 
 ~AlgoVisitor () override=default
 
virtual void walk (std::shared_ptr< Document< Trait > > doc)
 
- Public Member Functions inherited from MD::Visitor< Trait >
 Visitor ()=default
 
virtual ~Visitor ()=default
 
void process (std::shared_ptr< Document< Trait > > d)
 

Protected Member Functions

void onAddLineEnding () override
 
void onAnchor (Anchor< Trait > *a) override
 
void onBlockquote (Blockquote< Trait > *b) override
 
void onCode (Code< Trait > *c) override
 
void onFootnote (Footnote< Trait > *f) override
 
void onFootnoteRef (FootnoteRef< Trait > *ref) override
 
virtual void onFootnotes (std::shared_ptr< Document< Trait > > doc)
 
void onHeading (Heading< Trait > *h) override
 
void onHorizontalLine (HorizontalLine< Trait > *l) override
 
void onImage (Image< Trait > *i) override
 
void onInlineCode (Code< Trait > *c) override
 
void onLineBreak (LineBreak< Trait > *l) override
 
void onLink (Link< Trait > *l) override
 
void onList (List< Trait > *l) override
 
void onListItem (ListItem< Trait > *i, bool) override
 
void onMath (Math< Trait > *m) override
 
void onParagraph (Paragraph< Trait > *p, bool) override
 
void onRawHtml (RawHtml< Trait > *h) override
 
void onTable (Table< Trait > *t) override
 
void onTableCell (TableCell< Trait > *c) override
 
void onText (Text< Trait > *t) override
 
void onUserDefined (Item< Trait > *i) override
 
- Protected Member Functions inherited from MD::Visitor< Trait >

Protected Attributes

unsigned int m_currentNestingLevel = 0
 
ItemFunctor< Trait > m_func = {}
 
unsigned int m_maxNestingLevel = 0
 
const Trait::template Vector< ItemType > & m_types
 
- Protected Attributes inherited from MD::Visitor< Trait >
Trait::template Vector< typename Trait::String > m_anchors
 
std::shared_ptr< Document< Trait > > m_doc
 

Detailed Description

template<class Trait>
class MD::details::AlgoVisitor< Trait >

Visitor for algorithms.

Definition at line 32 of file algo.h.

Constructor & Destructor Documentation

◆ AlgoVisitor()

template<class Trait >
MD::details::AlgoVisitor< Trait >::AlgoVisitor ( unsigned int mnl,
const typename Trait::template Vector< ItemType > & t,
ItemFunctor< Trait > f )
inline

Definition at line 35 of file algo.h.

◆ ~AlgoVisitor()

template<class Trait >
MD::details::AlgoVisitor< Trait >::~AlgoVisitor ( )
overridedefault

Member Function Documentation

◆ onAddLineEnding()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onAddLineEnding ( )
inlineoverrideprotectedvirtual

For some generator it's important to keep line endings like they were in Markdown.

So onParagraph() method invokes this method when necessary to add line ending.

Implements MD::Visitor< Trait >.

Definition at line 55 of file algo.h.

◆ onAnchor()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onAnchor ( Anchor< Trait > * a)
inlineoverrideprotectedvirtual

Process anchor.

Implements MD::Visitor< Trait >.

Definition at line 212 of file algo.h.

◆ onBlockquote()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onBlockquote ( Blockquote< Trait > * b)
inlineoverrideprotectedvirtual

Process blockquote.

Reimplemented from MD::Visitor< Trait >.

Definition at line 148 of file algo.h.

◆ onCode()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onCode ( Code< Trait > * c)
inlineoverrideprotectedvirtual

Process code block.

Implements MD::Visitor< Trait >.

Definition at line 128 of file algo.h.

◆ onFootnote()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onFootnote ( Footnote< Trait > * f)
inlineoverrideprotectedvirtual

Process footnote.

Reimplemented from MD::Visitor< Trait >.

Definition at line 300 of file algo.h.

◆ onFootnoteRef()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onFootnoteRef ( FootnoteRef< Trait > * ref)
inlineoverrideprotectedvirtual

Process footnote reference.

Implements MD::Visitor< Trait >.

Definition at line 270 of file algo.h.

◆ onFootnotes()

template<class Trait >
virtual void MD::details::AlgoVisitor< Trait >::onFootnotes ( std::shared_ptr< Document< Trait > > doc)
inlineprotectedvirtual

Process all footnotes.

Definition at line 314 of file algo.h.

◆ onHeading()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onHeading ( Heading< Trait > * h)
inlineoverrideprotectedvirtual

Process heading.

Implements MD::Visitor< Trait >.

Definition at line 114 of file algo.h.

◆ onHorizontalLine()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onHorizontalLine ( HorizontalLine< Trait > * l)
inlineoverrideprotectedvirtual

Process horizontal line.

Implements MD::Visitor< Trait >.

Definition at line 232 of file algo.h.

◆ onImage()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onImage ( Image< Trait > * i)
inlineoverrideprotectedvirtual

Process Image.

Implements MD::Visitor< Trait >.

Definition at line 260 of file algo.h.

◆ onInlineCode()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onInlineCode ( Code< Trait > * c)
inlineoverrideprotectedvirtual

Process inline code.

Implements MD::Visitor< Trait >.

Definition at line 138 of file algo.h.

◆ onLineBreak()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onLineBreak ( LineBreak< Trait > * l)
inlineoverrideprotectedvirtual

Process line break.

Implements MD::Visitor< Trait >.

Definition at line 90 of file algo.h.

◆ onLink()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onLink ( Link< Trait > * l)
inlineoverrideprotectedvirtual

Process link.

Implements MD::Visitor< Trait >.

Definition at line 242 of file algo.h.

◆ onList()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onList ( List< Trait > * l)
inlineoverrideprotectedvirtual

Process list.

Implements MD::Visitor< Trait >.

Definition at line 162 of file algo.h.

◆ onListItem()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onListItem ( ListItem< Trait > * i,
bool  )
inlineoverrideprotectedvirtual

Process list item.

Reimplemented from MD::Visitor< Trait >.

Definition at line 280 of file algo.h.

◆ onMath()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onMath ( Math< Trait > * m)
inlineoverrideprotectedvirtual

Process LaTeX math item.

Implements MD::Visitor< Trait >.

Definition at line 80 of file algo.h.

◆ onParagraph()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onParagraph ( Paragraph< Trait > * p,
bool  )
inlineoverrideprotectedvirtual

Process paragraph.

Reimplemented from MD::Visitor< Trait >.

Definition at line 100 of file algo.h.

◆ onRawHtml()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onRawHtml ( RawHtml< Trait > * h)
inlineoverrideprotectedvirtual

Process raw HTML block.

Implements MD::Visitor< Trait >.

Definition at line 222 of file algo.h.

◆ onTable()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onTable ( Table< Trait > * t)
inlineoverrideprotectedvirtual

Process table.

Implements MD::Visitor< Trait >.

Definition at line 178 of file algo.h.

◆ onTableCell()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onTableCell ( TableCell< Trait > * c)
inlineoverrideprotectedvirtual

Process table cell.

Reimplemented from MD::Visitor< Trait >.

Definition at line 294 of file algo.h.

◆ onText()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onText ( Text< Trait > * t)
inlineoverrideprotectedvirtual

Process text item.

Implements MD::Visitor< Trait >.

Definition at line 70 of file algo.h.

◆ onUserDefined()

template<class Trait >
void MD::details::AlgoVisitor< Trait >::onUserDefined ( Item< Trait > * i)
inlineoverrideprotectedvirtual

Process user defined item type.

Reimplemented from MD::Visitor< Trait >.

Definition at line 60 of file algo.h.

◆ walk()

template<class Trait >
virtual void MD::details::AlgoVisitor< Trait >::walk ( std::shared_ptr< Document< Trait > > doc)
inlinevirtual

Walk through the document.

Definition at line 47 of file algo.h.

Member Data Documentation

◆ m_currentNestingLevel

template<class Trait >
unsigned int MD::details::AlgoVisitor< Trait >::m_currentNestingLevel = 0
protected

Current nesting level, increments/decrements during walking through te document.

Definition at line 323 of file algo.h.

◆ m_func

template<class Trait >
ItemFunctor<Trait> MD::details::AlgoVisitor< Trait >::m_func = {}
protected

Functor that will be invoked if all circumstances will be observed.

Definition at line 329 of file algo.h.

◆ m_maxNestingLevel

template<class Trait >
unsigned int MD::details::AlgoVisitor< Trait >::m_maxNestingLevel = 0
protected

Maximum allowed nesting level.

Definition at line 325 of file algo.h.

◆ m_types

template<class Trait >
const Trait::template Vector<ItemType>& MD::details::AlgoVisitor< Trait >::m_types
protected

List of types that should be processed.

Definition at line 327 of file algo.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Nov 6 2024 12:12:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.