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 205 of file docparser_p.h.

206{
207 while (n)
208 {
209 if (std::holds_alternative<DocHtmlBlockQuote>(*n)) return TRUE;
210 n=parent(n);
211 }
212 return FALSE;
213}
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:1327
#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 264 of file docparser_p.h.

265{
266 while (n)
267 {
268 if (std::holds_alternative<DocHtmlDetails>(*n)) return TRUE;
269 n=parent(n);
270 }
271 return FALSE;
272}

References FALSE, parent(), and TRUE.

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

◆ insideDL()

bool insideDL ( const DocNodeVariant * n)
inline

Definition at line 276 of file docparser_p.h.

277{
278 while (n)
279 {
280 if (std::holds_alternative<DocHtmlDescList>(*n)) return TRUE;
281 n=parent(n);
282 }
283 return FALSE;
284}

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 194 of file docparser_p.h.

195{
196 while (n)
197 {
198 if (std::holds_alternative<DocHtmlListItem>(*n)) return TRUE;
199 n=parent(n);
200 }
201 return FALSE;
202}

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 236 of file docparser_p.h.

237{
238 while (n)
239 {
240 if (std::holds_alternative<DocHtmlList>(*n) &&
241 std::get<DocHtmlList>(*n).type()==DocHtmlList::Ordered)
242 {
243 return TRUE;
244 }
245 n=parent(n);
246 }
247 return FALSE;
248}

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 183 of file docparser_p.h.

184{
185 while (n)
186 {
187 if (isPreformatted(n)) return TRUE;
188 n=parent(n);
189 }
190 return FALSE;
191}
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 252 of file docparser_p.h.

253{
254 while (n)
255 {
256 if (std::holds_alternative<DocHtmlTable>(*n)) return TRUE;
257 n=parent(n);
258 }
259 return FALSE;
260}

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 219 of file docparser_p.h.

220{
221 while (n)
222 {
223 if (std::holds_alternative<DocHtmlList>(*n) &&
224 std::get<DocHtmlList>(*n).type()==DocHtmlList::Unordered)
225 {
226 return TRUE;
227 }
228 n=parent(n);
229 }
230 return FALSE;
231}

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

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

◆ isPreformatted()

bool isPreformatted ( const DocNodeVariant * n)
inline

Definition at line 177 of file docparser_p.h.

178{
179 return std::visit([](auto &&x)->decltype(auto) { return x.isPreformatted(); }, *n);
180}

Referenced by insidePRE().