Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Text Processing - TemplateFileC
 

  PUBLIC
TemplateFileC::TemplateFileC(const StringC &,const OStreamC &)
TemplateFileC::TemplateFileC(TextFileC &,const OStreamC &)
TemplateFileC::TemplateFileC(TextFileC &,const OStreamC &,const RCHashC &)
TemplateFileC::Build(bool)
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 "Ravl/Text/TemplateFile.hh"
Created:04/03/99 
Source file:Ravl/OS/Text/TemplateFile.hh
User Level:Normal
Library:RavlOS
Example:exTemplateFile.cc
In Scope:RavlN

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;

RCHashC vars;

TextCursorC at;

StringC point;

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

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

TemplateFileC(TextFileC & templFile,const OStreamC & anOut,const RCHashC<StringC,StringC> & tab)
Constructor.

bool Build(bool 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.

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

bool 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.


Maintainer:Charles Galambos, Created: 04/03/99, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002