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

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

#include <cassert>
#include <stack>
#include <iterator>
#include <vector>
#include <deque>
#include <cstdint>
#include "containers.h"
#include "docparser.h"
#include "docnode.h"
#include "doctokenizer.h"
#include "searchindex.h"
#include "construct.h"
#include "cmdmapper.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  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 38 of file docparser_p.h.

◆ DocNodeStack

using DocNodeStack = std::stack<DocNodeVariant *>

Definition at line 39 of file docparser_p.h.

◆ DocStyleChangeStack

Definition at line 55 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 199 of file docparser_p.h.

200{
201 while (n)
202 {
203 if (std::holds_alternative<DocHtmlBlockQuote>(*n)) return TRUE;
204 n=parent(n);
205 }
206 return FALSE;
207}
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:1324
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References FALSE, parent(), and TRUE.

Referenced by DocPara::handleHtmlEndTag().

◆ insideDetails()

bool insideDetails ( const DocNodeVariant * n)
inline

Definition at line 258 of file docparser_p.h.

259{
260 while (n)
261 {
262 if (std::holds_alternative<DocHtmlDetails>(*n)) return TRUE;
263 n=parent(n);
264 }
265 return FALSE;
266}

References FALSE, parent(), and TRUE.

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

◆ insideDL()

bool insideDL ( const DocNodeVariant * n)
inline

Definition at line 270 of file docparser_p.h.

271{
272 while (n)
273 {
274 if (std::holds_alternative<DocHtmlDescList>(*n)) return TRUE;
275 n=parent(n);
276 }
277 return FALSE;
278}

References FALSE, parent(), and TRUE.

Referenced by DocPara::handleHtmlStartTag().

◆ insideLI()

bool insideLI ( const DocNodeVariant * n)
inline

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

Definition at line 188 of file docparser_p.h.

189{
190 while (n)
191 {
192 if (std::holds_alternative<DocHtmlListItem>(*n)) return TRUE;
193 n=parent(n);
194 }
195 return FALSE;
196}

References FALSE, parent(), and TRUE.

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

◆ insideOL()

bool insideOL ( const DocNodeVariant * n)
inline

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

Definition at line 230 of file docparser_p.h.

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

References FALSE, DocHtmlList::Ordered, parent(), and TRUE.

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

◆ insidePRE()

bool insidePRE ( const DocNodeVariant * n)
inline

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

Definition at line 177 of file docparser_p.h.

178{
179 while (n)
180 {
181 if (isPreformatted(n)) return TRUE;
182 n=parent(n);
183 }
184 return FALSE;
185}
bool isPreformatted(const DocNodeVariant *n)

References FALSE, isPreformatted(), parent(), and TRUE.

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

◆ insideTable()

bool insideTable ( const DocNodeVariant * n)
inline

Definition at line 246 of file docparser_p.h.

247{
248 while (n)
249 {
250 if (std::holds_alternative<DocHtmlTable>(*n)) return TRUE;
251 n=parent(n);
252 }
253 return FALSE;
254}

References FALSE, parent(), and TRUE.

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

◆ insideUL()

bool insideUL ( const DocNodeVariant * n)
inline

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

Definition at line 213 of file docparser_p.h.

214{
215 while (n)
216 {
217 if (std::holds_alternative<DocHtmlList>(*n) &&
218 std::get<DocHtmlList>(*n).type()==DocHtmlList::Unordered)
219 {
220 return TRUE;
221 }
222 n=parent(n);
223 }
224 return FALSE;
225}

References FALSE, parent(), TRUE, and DocHtmlList::Unordered.

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

◆ isPreformatted()

bool isPreformatted ( const DocNodeVariant * n)
inline

Definition at line 171 of file docparser_p.h.

172{
173 return std::visit([](auto &&x)->decltype(auto) { return x.isPreformatted(); }, *n);
174}

Referenced by insidePRE().