ALBA
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
albaHTMLTemplateParserBlock Class Reference

#include <albaHTMLTemplateParserBlock.h>

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

Classes

struct  parsedItems
 
struct  vars
 

Public Types

typedef struct albaHTMLTemplateParserBlock::vars HTMLTemplateSubstitution
 
typedef struct albaHTMLTemplateParserBlock::parsedItems HTMLTemplateParsedItems
 

Public Member Functions

 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 Member Functions

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)
 

Protected Attributes

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
 

Detailed Description

class name: albaHTMLTemplateParserBlock sub-class for Template parsing used by albaHTMLTemplateParser

Definition at line 53 of file albaHTMLTemplateParserBlock.h.

Member Typedef Documentation

◆ HTMLTemplateSubstitution

◆ HTMLTemplateParsedItems

Constructor & Destructor Documentation

◆ albaHTMLTemplateParserBlock()

albaHTMLTemplateParserBlock::albaHTMLTemplateParserBlock ( int  blockType,
wxString  name 
)

constructor

◆ ~albaHTMLTemplateParserBlock()

albaHTMLTemplateParserBlock::~albaHTMLTemplateParserBlock ( )

destructor

Member Function Documentation

◆ AddVar() [1/3]

void albaHTMLTemplateParserBlock::AddVar ( wxString  name,
double  varValue 
)

Add the variable specified in the name string to the list of variables.

◆ AddVar() [2/3]

void albaHTMLTemplateParserBlock::AddVar ( wxString  name,
int  varValue 
)

Add the variable specified in the name string to the list of variables.

◆ AddVar() [3/3]

void albaHTMLTemplateParserBlock::AddVar ( wxString  name,
wxString  varValue 
)

Add the variable specified in the name string to the list of variables.

◆ AddImageVar() [1/3]

void albaHTMLTemplateParserBlock::AddImageVar ( wxString  name,
wxString  imagePath = "",
wxString  label = "" 
)

Add the variable specified in the name string to the list of variables.

◆ AddImageVar() [2/3]

void albaHTMLTemplateParserBlock::AddImageVar ( wxString  name,
albaView view,
wxString  label = "" 
)

Add the variable specified in the name string to the list of variables.

◆ AddImageVar() [3/3]

void albaHTMLTemplateParserBlock::AddImageVar ( wxString  name,
vtkImageData *  imageData,
wxString  label = "",
int  flipAxis = -1 
)

Add the variable specified in the name string to the list of variables.

◆ PushImageVar() [1/3]

void albaHTMLTemplateParserBlock::PushImageVar ( wxString  name,
wxString  imagePath,
wxString  label = "" 
)

Push the variable specified in the name string to the list of variables.

◆ PushImageVar() [2/3]

void albaHTMLTemplateParserBlock::PushImageVar ( wxString  name,
albaView view,
wxString  label = "" 
)

Push the variable specified in the name string to the list of variables.

◆ PushImageVar() [3/3]

void albaHTMLTemplateParserBlock::PushImageVar ( wxString  name,
vtkImageData *  imageData,
wxString  label = "" 
)

Push the variable specified in the name string to the list of variables.

◆ PushVar() [1/3]

void albaHTMLTemplateParserBlock::PushVar ( wxString  name,
double  varValue 
)

Push the variable specified in the name string to the list of variables.

◆ PushVar() [2/3]

void albaHTMLTemplateParserBlock::PushVar ( wxString  name,
int  varValue 
)

Push the variable specified in the name string to the list of variables.

◆ PushVar() [3/3]

void albaHTMLTemplateParserBlock::PushVar ( wxString  name,
wxString  varValue 
)

Push the variable specified in the name string to the list of variables.

◆ GetVar()

wxString albaHTMLTemplateParserBlock::GetVar ( wxString  name)

Return the string of the Variable used for added vars.

◆ GetNthVar()

wxString albaHTMLTemplateParserBlock::GetNthVar ( wxString  name,
int  arrayPos = -1 
)

Return the string of the Variable Used for variable-arrays, if pos=-1 last pushed variable will be returned used for pushed vars.

◆ AddBlock()

void albaHTMLTemplateParserBlock::AddBlock ( wxString  name,
int  blockType 
)

Add the Block specified in the list of Blocks.

◆ PushBlock()

void albaHTMLTemplateParserBlock::PushBlock ( wxString  name,
int  blockType 
)

Push the Block specified in the list of Blocks.

◆ GetBlock()

albaHTMLTemplateParserBlock * albaHTMLTemplateParserBlock::GetBlock ( wxString  name)

Return the pointer to the block specified in name if the block is part of an block-array last pushed block will be returned.

◆ GetNthBlock()

albaHTMLTemplateParserBlock * albaHTMLTemplateParserBlock::GetNthBlock ( wxString  name,
int  pos = -1 
)

Return the pointer to the block specified in name and pos.

Used for block-arrays, if pos=-1 last pushed block will be returned

◆ SetIfCondition()

void albaHTMLTemplateParserBlock::SetIfCondition ( int  condition)

Set the verity value for the "if" blocks.

◆ GetIfCondition()

int albaHTMLTemplateParserBlock::GetIfCondition ( )

Set the verity value for the "if" blocks.

◆ SetNLoops()

void albaHTMLTemplateParserBlock::SetNLoops ( int  nloops)

Set the number of loops for the "if" blocks.

◆ GetNLoops()

int albaHTMLTemplateParserBlock::GetNLoops ( )

Set the number of loops for the "if" blocks.

◆ SetImageRTFProps()

void albaHTMLTemplateParserBlock::SetImageRTFProps ( int  widthGoal = 8640,
int  heightGoal = 12960,
int  mode = 1 
)

◆ SubstitutionPos()

int albaHTMLTemplateParserBlock::SubstitutionPos ( wxString *  name)
protected

Return the position of the variable in the Variable Table.

Returns -1 if variable is not found

◆ GetSubstitution()

HTMLTemplateSubstitution albaHTMLTemplateParserBlock::GetSubstitution ( wxString  name)
protected

Finds a variable starting from his name.

◆ WriteSubstitution()

void albaHTMLTemplateParserBlock::WriteSubstitution ( HTMLTemplateSubstitution  var,
wxString *  outputHTML 
)
protected

Write a specified Var to the output.

◆ PreParse()

void albaHTMLTemplateParserBlock::PreParse ( wxString *  inputTemplate,
int &  parsingPos 
)
protected

Generate PreParsing structures from input template for this block and return the number of parsed chars.

◆ PreParseTag()

int albaHTMLTemplateParserBlock::PreParseTag ( wxString *  inputTemplate,
int &  parsingPos 
)
protected

Parse the input starting from a tag.

◆ SkipInputSpaces()

void albaHTMLTemplateParserBlock::SkipInputSpaces ( wxString *  inputTemplate,
int &  parsingPos 
)
protected

Utility function that skip spaces on input template.

◆ AddSubstitution()

int albaHTMLTemplateParserBlock::AddSubstitution ( wxString *  tagName,
int  SubstitutionType 
)
protected

AddSubstitution to m_Subistitution if necessary search the correspondent variable to the block root, returns the position of the added substitution.

◆ AddForward()

int albaHTMLTemplateParserBlock::AddForward ( wxString *  tagName,
int  substitutionType 
)
protected

This function is called when a substitution is not found in local scope in order to search it upward to the blocks root.

Returns the father substitution pos and generates a path to the substitution if is necessary

◆ SubStringCompare()

int albaHTMLTemplateParserBlock::SubStringCompare ( wxString *  input,
char *  subString,
int  inputPos 
)
protected

Return true if input contains subString starting from inputPos.

◆ CleanPreParsingInfo()

void albaHTMLTemplateParserBlock::CleanPreParsingInfo ( )
protected

Clean the structures generated on PreParse phase.

◆ GenerateOutput()

void albaHTMLTemplateParserBlock::GenerateOutput ( wxString *  outputHTML)
protected

Generate HTML output.

◆ ReadTagName()

void albaHTMLTemplateParserBlock::ReadTagName ( wxString *  inputTemplate,
int &  parsingPos,
wxString &  tagName 
)
protected

Reads the name of the tag from the input template and save it to varName.

This function skips spaces and the closing char ']'

◆ ConsistenceCheck()

int albaHTMLTemplateParserBlock::ConsistenceCheck ( )
protected

Check the consistence of the generated structure.

◆ SetFather()

void albaHTMLTemplateParserBlock::SetFather ( albaHTMLTemplateParserBlock father)
protected

Sets the father for the block.

◆ CalculateImageRTF()

wxString albaHTMLTemplateParserBlock::CalculateImageRTF ( wxString  imagePath,
int  width,
int  height 
)
protected

Member Data Documentation

◆ m_ImageRTF_WidthGoal

int albaHTMLTemplateParserBlock::m_ImageRTF_WidthGoal
protected

Definition at line 189 of file albaHTMLTemplateParserBlock.h.

◆ m_ImageRTF_HeightGoal

int albaHTMLTemplateParserBlock::m_ImageRTF_HeightGoal
protected

Definition at line 190 of file albaHTMLTemplateParserBlock.h.

◆ m_ImageRTF_Mode

int albaHTMLTemplateParserBlock::m_ImageRTF_Mode
protected

Definition at line 191 of file albaHTMLTemplateParserBlock.h.

◆ m_Father

albaHTMLTemplateParserBlock* albaHTMLTemplateParserBlock::m_Father
protected

Definition at line 194 of file albaHTMLTemplateParserBlock.h.

◆ m_BlockName

wxString albaHTMLTemplateParserBlock::m_BlockName
protected

Definition at line 196 of file albaHTMLTemplateParserBlock.h.

◆ m_BlockType

int albaHTMLTemplateParserBlock::m_BlockType
protected

Definition at line 197 of file albaHTMLTemplateParserBlock.h.

◆ m_IfChars

int albaHTMLTemplateParserBlock::m_IfChars
protected

Definition at line 199 of file albaHTMLTemplateParserBlock.h.

◆ m_IfCondition

bool albaHTMLTemplateParserBlock::m_IfCondition
protected

Definition at line 200 of file albaHTMLTemplateParserBlock.h.

◆ m_DoubleFormat

wxString albaHTMLTemplateParserBlock::m_DoubleFormat
protected

Definition at line 202 of file albaHTMLTemplateParserBlock.h.

◆ m_CurrentLoop

int albaHTMLTemplateParserBlock::m_CurrentLoop
protected

Definition at line 203 of file albaHTMLTemplateParserBlock.h.

◆ m_LoopsNumber

int albaHTMLTemplateParserBlock::m_LoopsNumber
protected

Definition at line 204 of file albaHTMLTemplateParserBlock.h.

◆ m_SubstitutionTable

std::vector<HTMLTemplateSubstitution> albaHTMLTemplateParserBlock::m_SubstitutionTable
protected

Definition at line 206 of file albaHTMLTemplateParserBlock.h.

◆ m_Variables

std::vector< wxString > albaHTMLTemplateParserBlock::m_Variables
protected

Definition at line 208 of file albaHTMLTemplateParserBlock.h.

◆ m_VariablesArray

std::vector< std::vector<wxString> > albaHTMLTemplateParserBlock::m_VariablesArray
protected

Definition at line 209 of file albaHTMLTemplateParserBlock.h.

◆ m_SubBlocks

std::vector< albaHTMLTemplateParserBlock * > albaHTMLTemplateParserBlock::m_SubBlocks
protected

Definition at line 211 of file albaHTMLTemplateParserBlock.h.

◆ m_SubBlocksArray

std::vector< std::vector< albaHTMLTemplateParserBlock * > > albaHTMLTemplateParserBlock::m_SubBlocksArray
protected

Definition at line 212 of file albaHTMLTemplateParserBlock.h.

◆ m_PreParsedHTML

wxString albaHTMLTemplateParserBlock::m_PreParsedHTML
protected

Definition at line 214 of file albaHTMLTemplateParserBlock.h.

◆ m_Substitutions

std::vector< HTMLTemplateParsedItems > albaHTMLTemplateParserBlock::m_Substitutions
protected

Definition at line 215 of file albaHTMLTemplateParserBlock.h.


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