Doxygen
Loading...
Searching...
No Matches
docparser_p.h File Reference

Private header shared between docparser.cpp and docnode.cpp. More...

#include <cassert>
#include <cstdint>
#include <deque>
#include <stack>
#include <vector>
#include "cmdmapper.h"
#include "construct.h"
#include "containers.h"
#include "docnode.h"
#include "docparser.h"
Include dependency graph for docparser_p.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IterableStack< T, Container >
struct  DocParserContext
 Parser's context to store all global variables. More...
class  DocParser
class  DocParser::AutoSaveContext
class  AutoNodeStack

Typedefs

using DefinitionStack = std::vector<const Definition *>
using DocNodeStack = std::stack<DocNodeVariant *>
using DocStyleChangeStack = IterableStack<const DocNodeVariant *>

Functions

bool isPreformatted (const DocNodeVariant *n)
bool insidePRE (const DocNodeVariant *n)
bool insideLI (const DocNodeVariant *n)
bool insideBlockQuote (const DocNodeVariant *n)
bool insideUL (const DocNodeVariant *n)
bool insideOL (const DocNodeVariant *n)
bool insideTable (const DocNodeVariant *n)
bool insideDetails (const DocNodeVariant *n)
bool insideDL (const DocNodeVariant *n)

Detailed Description

Private header shared between docparser.cpp and docnode.cpp.

Definition in file docparser_p.h.

Typedef Documentation

◆ DefinitionStack

using DefinitionStack = std::vector<const Definition *>

Definition at line 37 of file docparser_p.h.

◆ DocNodeStack

using DocNodeStack = std::stack<DocNodeVariant *>

Definition at line 38 of file docparser_p.h.

◆ DocStyleChangeStack

Definition at line 54 of file docparser_p.h.

Function Documentation

◆ insideBlockQuote()

bool insideBlockQuote ( const DocNodeVariant * n)
inline

Returns true iff node n is a child of a html list item node

Definition at line 215 of file docparser_p.h.

216{
217 while (n)
218 {
219 if (std::holds_alternative<DocHtmlBlockQuote>(*n)) return true;
220 n=parent(n);
221 }
222 return false;
223}
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1335

References insideBlockQuote(), and parent().

Referenced by DocPara::handleHtmlEndTag(), and insideBlockQuote().

◆ insideDetails()

bool insideDetails ( const DocNodeVariant * n)
inline

Definition at line 274 of file docparser_p.h.

275{
276 while (n)
277 {
278 if (std::holds_alternative<DocHtmlDetails>(*n)) return true;
279 n=parent(n);
280 }
281 return false;
282}

References insideDetails(), and parent().

Referenced by DocPara::handleHtmlEndTag(), DocPara::handleHtmlStartTag(), and insideDetails().

◆ insideDL()

bool insideDL ( const DocNodeVariant * n)
inline

Definition at line 286 of file docparser_p.h.

287{
288 while (n)
289 {
290 if (std::holds_alternative<DocHtmlDescList>(*n)) return true;
291 n=parent(n);
292 }
293 return false;
294}

References insideDL(), and parent().

Referenced by DocPara::handleHtmlStartTag(), and insideDL().

◆ insideLI()

bool insideLI ( const DocNodeVariant * n)
inline

Returns true iff node n is a child of a html list item node

Definition at line 204 of file docparser_p.h.

205{
206 while (n)
207 {
208 if (std::holds_alternative<DocHtmlListItem>(*n)) return true;
209 n=parent(n);
210 }
211 return false;
212}

References insideLI(), and parent().

Referenced by DocPara::handleHtmlEndTag(), DocParser::handleStyleArgument(), and insideLI().

◆ insideOL()

bool insideOL ( const DocNodeVariant * n)
inline

Returns true iff node n is a child of a ordered html list node

Definition at line 246 of file docparser_p.h.

247{
248 while (n)
249 {
250 if (std::holds_alternative<DocHtmlList>(*n) &&
251 std::get<DocHtmlList>(*n).type()==DocHtmlList::Ordered)
252 {
253 return true;
254 }
255 n=parent(n);
256 }
257 return false;
258}

References insideOL(), DocHtmlList::Ordered, and parent().

Referenced by DocPara::handleHtmlEndTag(), DocPara::handleHtmlStartTag(), and insideOL().

◆ insidePRE()

bool insidePRE ( const DocNodeVariant * n)
inline

Returns true iff node n is a child of a preformatted node

Definition at line 193 of file docparser_p.h.

194{
195 while (n)
196 {
197 if (isPreformatted(n)) return true;
198 n=parent(n);
199 }
200 return false;
201}
bool isPreformatted(const DocNodeVariant *n)

References insidePRE(), isPreformatted(), and parent().

Referenced by DocParser::defaultHandleToken(), insidePRE(), and DocPara::parse().

◆ insideTable()

bool insideTable ( const DocNodeVariant * n)
inline

Definition at line 262 of file docparser_p.h.

263{
264 while (n)
265 {
266 if (std::holds_alternative<DocHtmlTable>(*n)) return true;
267 n=parent(n);
268 }
269 return false;
270}

References insideTable(), and parent().

Referenced by filterLatexString(), DocPara::handleHtmlStartTag(), and insideTable().

◆ insideUL()

bool insideUL ( const DocNodeVariant * n)
inline

Returns true iff node n is a child of a unordered html list node

Definition at line 229 of file docparser_p.h.

230{
231 while (n)
232 {
233 if (std::holds_alternative<DocHtmlList>(*n) &&
234 std::get<DocHtmlList>(*n).type()==DocHtmlList::Unordered)
235 {
236 return true;
237 }
238 n=parent(n);
239 }
240 return false;
241}

References insideUL(), parent(), and DocHtmlList::Unordered.

Referenced by DocPara::handleHtmlEndTag(), DocPara::handleHtmlStartTag(), and insideUL().

◆ isPreformatted()

bool isPreformatted ( const DocNodeVariant * n)
inline

Definition at line 187 of file docparser_p.h.

188{
189 return std::visit([](auto &&x)->decltype(auto) { return x.isPreformatted(); }, *n);
190}

References isPreformatted().

Referenced by insidePRE(), and isPreformatted().