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

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

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

References FALSE, parent(), and TRUE.

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

◆ insideDL()

bool insideDL ( const DocNodeVariant * n)
inline

Definition at line 275 of file docparser_p.h.

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

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

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

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

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

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

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

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

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

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

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

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

◆ isPreformatted()

bool isPreformatted ( const DocNodeVariant * n)
inline

Definition at line 176 of file docparser_p.h.

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

Referenced by insidePRE().