ALBA
Public Member Functions | Protected Attributes | List of all members
albaHTMLTemplateParser Class Reference

#include <albaHTMLTemplateParser.h>

Inheritance diagram for albaHTMLTemplateParser:
Inheritance graph
[legend]
Collaboration diagram for albaHTMLTemplateParser:
Collaboration graph
[legend]

Public Member Functions

 albaHTMLTemplateParser ()
 
 ~albaHTMLTemplateParser ()
 
void SetTemplateFromFile (wxString filename)
 
void SetTemplateFromString (wxString templateString)
 
wxString GetOutputString ()
 
void WriteOutputFile (wxString filename)
 
void Parse ()
 
- Public Member Functions inherited from albaHTMLTemplateParserBlock
 albaHTMLTemplateParserBlock (int blockType, wxString name)
 
 ~albaHTMLTemplateParserBlock ()
 
void AddVar (wxString name, double varValue)
 
void AddVar (wxString name, int varValue)
 
void AddVar (wxString name, wxString varValue)
 
void AddImageVar (wxString name, wxString imagePath="", wxString label="")
 
void AddImageVar (wxString name, albaView *view, wxString label="")
 
void AddImageVar (wxString name, vtkImageData *imageData, wxString label="", int flipAxis=-1)
 
void PushImageVar (wxString name, wxString imagePath, wxString label="")
 
void PushImageVar (wxString name, albaView *view, wxString label="")
 
void PushImageVar (wxString name, vtkImageData *imageData, wxString label="")
 
void PushVar (wxString name, double varValue)
 
void PushVar (wxString name, int varValue)
 
void PushVar (wxString name, wxString varValue)
 
wxString GetVar (wxString name)
 
wxString GetNthVar (wxString name, int arrayPos=-1)
 
void AddBlock (wxString name, int blockType)
 
void PushBlock (wxString name, int blockType)
 
albaHTMLTemplateParserBlockGetBlock (wxString name)
 
albaHTMLTemplateParserBlockGetNthBlock (wxString name, int pos=-1)
 
void SetIfCondition (int condition)
 
int GetIfCondition ()
 
void SetNLoops (int nloops)
 
int GetNLoops ()
 
void SetImageRTFProps (int widthGoal=8640, int heightGoal=12960, int mode=1)
 

Protected Attributes

wxString m_Template
 
wxString m_Output
 
- Protected Attributes inherited from albaHTMLTemplateParserBlock
int m_ImageRTF_WidthGoal
 
int m_ImageRTF_HeightGoal
 
int m_ImageRTF_Mode
 
albaHTMLTemplateParserBlockm_Father
 
wxString m_BlockName
 
int m_BlockType
 
int m_IfChars
 
bool m_IfCondition
 
wxString m_DoubleFormat
 
int m_CurrentLoop
 
int m_LoopsNumber
 
std::vector< HTMLTemplateSubstitutionm_SubstitutionTable
 
std::vector< wxString > m_Variables
 
std::vector< std::vector< wxString > > m_VariablesArray
 
std::vector< albaHTMLTemplateParserBlock * > m_SubBlocks
 
std::vector< std::vector< albaHTMLTemplateParserBlock * > > m_SubBlocksArray
 
wxString m_PreParsedHTML
 
std::vector< HTMLTemplateParsedItemsm_Substitutions
 

Additional Inherited Members

- Public Types inherited from albaHTMLTemplateParserBlock
typedef struct albaHTMLTemplateParserBlock::vars HTMLTemplateSubstitution
 
typedef struct albaHTMLTemplateParserBlock::parsedItems HTMLTemplateParsedItems
 
- Protected Member Functions inherited from albaHTMLTemplateParserBlock
int SubstitutionPos (wxString *name)
 
HTMLTemplateSubstitution GetSubstitution (wxString name)
 
void WriteSubstitution (HTMLTemplateSubstitution var, wxString *outputHTML)
 
void PreParse (wxString *inputTemplate, int &parsingPos)
 
int PreParseTag (wxString *inputTemplate, int &parsingPos)
 
void SkipInputSpaces (wxString *inputTemplate, int &parsingPos)
 
int AddSubstitution (wxString *tagName, int SubstitutionType)
 
int AddForward (wxString *tagName, int substitutionType)
 
int SubStringCompare (wxString *input, char *subString, int inputPos)
 
void CleanPreParsingInfo ()
 
void GenerateOutput (wxString *outputHTML)
 
void ReadTagName (wxString *inputTemplate, int &parsingPos, wxString &tagName)
 
int ConsistenceCheck ()
 
void SetFather (albaHTMLTemplateParserBlock *father)
 
wxString CalculateImageRTF (wxString imagePath, int width, int height)
 

Detailed Description

class name: albaHTMLTemplateParser class for Template parsing of a text file/string (typically an html) with management of Variables/Loop/If-Else condition Tags Are: [ALBAVariable varName] [ALBALoop loopName] [/ALBALoop loopName] [ALBAIf ifName] [ALBAElse ifName] [/ALBAIf ifName] (else is optional)*

Definition at line 35 of file albaHTMLTemplateParser.h.

Constructor & Destructor Documentation

◆ albaHTMLTemplateParser()

albaHTMLTemplateParser::albaHTMLTemplateParser ( )

constructor

◆ ~albaHTMLTemplateParser()

albaHTMLTemplateParser::~albaHTMLTemplateParser ( )

destructor

Member Function Documentation

◆ SetTemplateFromFile()

void albaHTMLTemplateParser::SetTemplateFromFile ( wxString  filename)

Set the template from a file.

◆ SetTemplateFromString()

void albaHTMLTemplateParser::SetTemplateFromString ( wxString  templateString)

Set the template from a string.

◆ GetOutputString()

wxString albaHTMLTemplateParser::GetOutputString ( )

Return the Parsed output.

◆ WriteOutputFile()

void albaHTMLTemplateParser::WriteOutputFile ( wxString  filename)

Writes the output to disk.

◆ Parse()

void albaHTMLTemplateParser::Parse ( )

Template parsing
Updates all the structures and generate internal output Note: this function must be called before GetOutputString() or WriteOutput() functions.

Member Data Documentation

◆ m_Template

wxString albaHTMLTemplateParser::m_Template
protected

Definition at line 61 of file albaHTMLTemplateParser.h.

◆ m_Output

wxString albaHTMLTemplateParser::m_Output
protected

Definition at line 62 of file albaHTMLTemplateParser.h.


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