LibreOffice Module helpcompiler (master) 1
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
BasicCodeTagger Class Reference

Tagger class. More...

#include <BasCodeTagger.hxx>

Collaboration diagram for BasicCodeTagger:
[legend]

Public Types

enum  TaggerException {
  NULL_DOCUMENT ,
  EMPTY_DOCUMENT
}
 

Public Member Functions

 BasicCodeTagger (xmlDocPtr rootDoc)
 
 ~BasicCodeTagger ()
 
void tagBasicCodes ()
 Manages tagging process. More...
 

Private Member Functions

void tagParagraph (xmlNodePtr paragraph)
 Used by tagBasCodeParagraphs(). It does the work on the current paragraph containing Basic code. More...
 
void getBasicCodeContainerNodes ()
 Gathers all the <bascode> tag nodes from xml tree. More...
 
void tagBasCodeParagraphs ()
 Extracts Basic Codes contained in <bascode> tags. More...
 

Static Private Member Functions

static xmlChar * getTypeString (TokenType tokenType)
 Converts SyntaxHighlighter's TokenTypes enum to a type string for More...
 

Private Attributes

xmlDocPtr m_pDocument
 
std::vector< xmlNodePtr > m_BasicCodeContainerTags
 
std::unique_ptr< LibXmlTreeWalkerm_pXmlTreeWalker
 
SyntaxHighlighter m_Highlighter
 
bool m_bTaggingCompleted
 

Detailed Description

Tagger class.

Definition at line 21 of file BasCodeTagger.hxx.

Member Enumeration Documentation

◆ TaggerException

Enumerator
NULL_DOCUMENT 
EMPTY_DOCUMENT 

Definition at line 35 of file BasCodeTagger.hxx.

Constructor & Destructor Documentation

◆ BasicCodeTagger()

BasicCodeTagger::BasicCodeTagger ( xmlDocPtr  rootDoc)

Definition at line 53 of file BasCodeTagger.cxx.

References Basic, m_bTaggingCompleted, m_pDocument, m_pXmlTreeWalker, and NULL_DOCUMENT.

◆ ~BasicCodeTagger()

BasicCodeTagger::~BasicCodeTagger ( )

Definition at line 63 of file BasCodeTagger.cxx.

Member Function Documentation

◆ getBasicCodeContainerNodes()

void BasicCodeTagger::getBasicCodeContainerNodes ( )
private

Gathers all the <bascode> tag nodes from xml tree.

Assumes m_pDocument is valid. Handles m_pXmlTreeWalker and m_BasicCodeContainerTags members.

Definition at line 70 of file BasCodeTagger.cxx.

References m_BasicCodeContainerTags, m_pDocument, and m_pXmlTreeWalker.

Referenced by tagBasicCodes().

◆ getTypeString()

xmlChar * BasicCodeTagger::getTypeString ( TokenType  tokenType)
staticprivate

Converts SyntaxHighlighter's TokenTypes enum to a type string for

Definition at line 184 of file BasCodeTagger.cxx.

Referenced by tagParagraph().

◆ tagBasCodeParagraphs()

void BasicCodeTagger::tagBasCodeParagraphs ( )
private

Extracts Basic Codes contained in <bascode> tags.

For each <bascode> this method iterates through it's <paragraph> tags and "inserts" tags according to the Basic code syntax found in that paragraph.

Definition at line 99 of file BasCodeTagger.cxx.

References m_BasicCodeContainerTags, and tagParagraph().

Referenced by tagBasicCodes().

◆ tagBasicCodes()

void BasicCodeTagger::tagBasicCodes ( )

Manages tagging process.

This is the "main" function of BasicCodeTagger.

Definition at line 164 of file BasCodeTagger.cxx.

References ex, getBasicCodeContainerNodes(), m_bTaggingCompleted, and tagBasCodeParagraphs().

Referenced by HelpCompiler::tagBasicCodeExamples().

◆ tagParagraph()

void BasicCodeTagger::tagParagraph ( xmlNodePtr  paragraph)
private

Used by tagBasCodeParagraphs(). It does the work on the current paragraph containing Basic code.

Definition at line 116 of file BasCodeTagger.cxx.

References SyntaxHighlighter::getHighlightPortions(), getTypeString(), m_Highlighter, m_pDocument, OUStringToOString(), paragraph, and text().

Referenced by tagBasCodeParagraphs().

Member Data Documentation

◆ m_BasicCodeContainerTags

std::vector<xmlNodePtr> BasicCodeTagger::m_BasicCodeContainerTags
private

Definition at line 25 of file BasCodeTagger.hxx.

Referenced by getBasicCodeContainerNodes(), and tagBasCodeParagraphs().

◆ m_bTaggingCompleted

bool BasicCodeTagger::m_bTaggingCompleted
private

Definition at line 28 of file BasCodeTagger.hxx.

Referenced by BasicCodeTagger(), and tagBasicCodes().

◆ m_Highlighter

SyntaxHighlighter BasicCodeTagger::m_Highlighter
private

Definition at line 27 of file BasCodeTagger.hxx.

Referenced by tagParagraph().

◆ m_pDocument

xmlDocPtr BasicCodeTagger::m_pDocument
private

Definition at line 24 of file BasCodeTagger.hxx.

Referenced by BasicCodeTagger(), getBasicCodeContainerNodes(), and tagParagraph().

◆ m_pXmlTreeWalker

std::unique_ptr<LibXmlTreeWalker> BasicCodeTagger::m_pXmlTreeWalker
private

Definition at line 26 of file BasCodeTagger.hxx.

Referenced by BasicCodeTagger(), and getBasicCodeContainerNodes().


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