Developer Documentation
Centre for Vision, Speech & Signal Processing
USER IN NAMESPACE AMMA TREE ROOT AMMA SEARCH AMMA HOME
 

  PUBLIC
TemplateFileC::TemplateFileC(FilenameC,const OStreamC &)
TemplateFileC::TemplateFileC(TextPFileC &,const OStreamC &)
TemplateFileC::TemplateFileC(TextPFileC &,const OStreamC &,const RCHashARC &)
TemplateFileC::Build(BooleanT)
TemplateFileC::IsElm(void) const
TemplateFileC::First(void)
TemplateFileC::Next(void)
TemplateFileC::Data(void)
TemplateFileC::Output(void)
TemplateFileC::SetVar(const StringC &,const StringC &)
TemplateFileC::ErrorLabel(void)
TemplateFileC::ClipVar(TextCursorC &)
TemplateFileC
 
Subsitute variables in a template file.
 
include "amma/TemplateFile.hh"
User Level:Default
Library:TextProc
Example:exTemplateFile.cc
Section:default.Charles Galambos
In Scope:std

Comments:
This is a small object.

Variables in the input are of the form $(tag) where tag is used to determine what should be placed in the output file. If you wish to avoid a substitution use $$(tag) in the template file, it becomes $(tag) in the output file

Variables:
OStreamC out;

RCHashARC vars;

TextCursorC at;

StringC point;

Methods:
TemplateFileC(FilenameC templName,const OStreamC & anOut)
Constructor.

TemplateFileC(TextPFileC & templFile,const OStreamC & anOut)
Constructor.

TemplateFileC(TextPFileC & templFile,const OStreamC & anOut,const RCHashARC<StringC,StringC> & tab)
Constructor.

BooleanT Build(BooleanT userWillHandleExceptions = FALSE)
Build a template output file based on those variables setup with 'SetVar'.
This function is NOT to be used with 'First','Next' and 'IsElm'. Returns TRUE if completed without error, otherwise FALSE.

BooleanT IsElm() const
Still more to do ?
NB. Unlike other iterators First() must be called before IsElm() returns a valid result.

BooleanT First()
Start reading template file.
If returns FALSE, everything is finished already.

StringC & Next()
Goto next insertion point.
returns name of insertion point. Empty string if done.



StringC & Data()
Returns name of current insertion point.

OStreamC & Output()
Where is the output going ?

void SetVar(const StringC & id,const StringC & value)
Set the value of a variable.

void ErrorLabel()
Print an error message about the label.

StringC ClipVar(TextCursorC & at)
Clip out variable.


Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001