Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
dxl::Index::Parser Struct Reference

Description:

Internal struct that parses a tag-file. Used by the method loadTagFile.

Definition at line 255 of file index.hpp.

#include <index.hpp>

Public Field Index:

alib::ListMA< TGTDocAnchor * > actDocAnchors
 Set by nextLine() in case it finds a <docanchor>.
DoxygenXLinks & dxl
 our parent's parent
alib::system::PathString FilePath
 The path to the doxygenTagFile.
Indexindex
 our parent
alib::Substring line
 A parser for the currently read line.
alib::String2K lineBuf
 The buffer of the line currently read.
int lineNo = 0
 The current line number when reading.
alib::MonoAllocatorma
 A referenced to the allocator of outer class Index.
alib::integer maxWidth = 0
 The maximum line width found.
alib::IStreamReaderreader
 A referenced to the ALib text file reader tool.
alib::Substring tagAttr
 The current tag attributes. Set by parseTag.
alib::lox::Verbosity verbosity
 The log verbosity of the parser (used for performance optimization).

Public Method Index:

 Parser (Index &parent, alib::IStreamReader &pReader, const alib::String &pFilePath)
void addDocAnchors (Cursor &parent)
alib::String allocNextTag (const alib::String &tagName)
alib::String allocTag (const alib::String &tagName)
alib::String getAttr (const alib::String &key)
void nextLine ()
alib::String nextTag (const alib::String &tagName)
alib::String parseAttr (const alib::String &attrName, bool isOptional=false)
alib::String parseTag (const alib::String &tagName)
TGTMemberreadMember (alib::String512 &key, Target::Kinds compoundKind)
 todo: add parameter parent and if html file is the same, then re-use instead of allocation.
alib::String tryTag (const alib::String &tagName)

Field Details:

◆ actDocAnchors

alib::ListMA<TGTDocAnchor*> dxl::Index::Parser::actDocAnchors

Set by nextLine() in case it finds a <docanchor>.

Definition at line 290 of file index.hpp.

◆ dxl

DoxygenXLinks& dxl::Index::Parser::dxl

our parent's parent

Definition at line 260 of file index.hpp.

◆ FilePath

alib::system::PathString dxl::Index::Parser::FilePath

The path to the doxygenTagFile.

Definition at line 272 of file index.hpp.

◆ index

Index& dxl::Index::Parser::index

our parent

Definition at line 257 of file index.hpp.

◆ line

alib::Substring dxl::Index::Parser::line

A parser for the currently read line.

Definition at line 281 of file index.hpp.

◆ lineBuf

alib::String2K dxl::Index::Parser::lineBuf

The buffer of the line currently read.

Definition at line 278 of file index.hpp.

◆ lineNo

int dxl::Index::Parser::lineNo = 0

The current line number when reading.

Definition at line 275 of file index.hpp.

◆ ma

alib::MonoAllocator& dxl::Index::Parser::ma

A referenced to the allocator of outer class Index.

Definition at line 263 of file index.hpp.

◆ maxWidth

alib::integer dxl::Index::Parser::maxWidth = 0

The maximum line width found.

Definition at line 287 of file index.hpp.

◆ reader

alib::IStreamReader& dxl::Index::Parser::reader

A referenced to the ALib text file reader tool.

Definition at line 269 of file index.hpp.

◆ tagAttr

alib::Substring dxl::Index::Parser::tagAttr

The current tag attributes. Set by parseTag.

Definition at line 284 of file index.hpp.

◆ verbosity

alib::lox::Verbosity dxl::Index::Parser::verbosity

The log verbosity of the parser (used for performance optimization).

Definition at line 266 of file index.hpp.

Constructor(s) / Destructor Details:

◆ Parser()

dxl::Index::Parser::Parser ( Index & parent,
alib::IStreamReader & pReader,
const alib::String & pFilePath )

Constructor

Parameters
parentThe index this instance belongs to.
pReaderThe input data.
pFilePathThe file path of the tag-file.

Definition at line 22 of file tagfile.cpp.

Method Details:

◆ addDocAnchors()

void dxl::Index::Parser::addDocAnchors ( Cursor & parent)

Adds all anchors in actDocAnchors to the given parent node and clears the list.

Parameters
parentThe parent node that receives the anchors as children.

Definition at line 64 of file tagfile.cpp.

◆ allocNextTag()

alib::String dxl::Index::Parser::allocNextTag ( const alib::String & tagName)
inline

Calls nextTag and allocates the result in our MonoAllocator.

Parameters
tagNameThe name of the tag to parse.
Returns
The allocated copy of the parsed tag.

Definition at line 342 of file index.hpp.

◆ allocTag()

alib::String dxl::Index::Parser::allocTag ( const alib::String & tagName)
inline

Calls parseTag and allocates the result in our MonoAllocator.

Parameters
tagNameThe name of the tag to parse.
Returns
The allocated copy of the parsed tag.

Definition at line 323 of file index.hpp.

◆ getAttr()

alib::String dxl::Index::Parser::getAttr ( const alib::String & key)
inline

parses an XML-attribute with the given key from field tagAttr.

Parameters
keyThe key of the attribute to parse.
Returns
The attribute value.

Definition at line 301 of file index.hpp.

◆ nextLine()

void dxl::Index::Parser::nextLine ( )

Reads the next line of the file into lineBuf. Increases lineNo and sets line. If it reads a Doxygen <docanchor> text, that anchor is added to the actCompound.

Note
This might not be the nicest design, but it's an effective solution. Doc-Anchors can just appear in any component.

Definition at line 31 of file tagfile.cpp.

◆ nextTag()

alib::String dxl::Index::Parser::nextTag ( const alib::String & tagName)
inline

Calls nextLine and then parseTag.

Parameters
tagNameThe name of the tag to parse.
Returns
The allocated copy of the parsed tag.

Definition at line 337 of file index.hpp.

◆ parseAttr()

String dxl::Index::Parser::parseAttr ( const alib::String & attrName,
bool isOptional = false )

Parses the given attribute from the current string in tagAttr. If not found, an exception is thrown.

Parameters
attrNameThe name of the attribute to parse.
isOptionalif false if given, an error is logged if the attribute was not found.
Returns
the contents of the tag.

Definition at line 146 of file tagfile.cpp.

◆ parseTag()

String dxl::Index::Parser::parseTag ( const alib::String & tagName)

Parses the given tag from the actual line. If the tag has attributes, that string is copied to the field tagAttr. Otherwise, that field is nulled.

Parameters
tagNameThe name of the tag to parse.
Returns
the contents of the tag.

Definition at line 98 of file tagfile.cpp.

◆ readMember()

TGTMember * dxl::Index::Parser::readMember ( alib::String512 & key,
Target::Kinds compoundKind )

todo: add parameter parent and if html file is the same, then re-use instead of allocation.

Reads a member at the actual position. The returned key equals the member name. With function-members, in addition, the argument list is added by using the method PARSE and likewise the field Qualifiers.

If the compoundKind indicates a Doxygen group, then parsing is very tolerant because most members are just references to entities defined elsewhere.

Parameters
[out]keyThe key to use for the string tree.
compoundKindThe kind of the compound actually parsed.
Returns
A member struct of a type derived of type TGTMember.

Definition at line 187 of file tagfile.cpp.

◆ tryTag()

alib::String dxl::Index::Parser::tryTag ( const alib::String & tagName)
inline

Tries to identify tagName in the current line. If found, parseTag is called.

Parameters
tagNameThe name of the tag to try to parse.
Returns
On success the parsed tag, a nulled string otherwise.

Definition at line 349 of file index.hpp.


The documentation for this struct was generated from the following files: