fpTemplate unit
Simple template parsing mechanism.
fpTemplate implements a class
TTemplateParser which can replace variables in a template text.
The template variables are enclosed in delimiters. When a variable is encountered, it can be replaced by a string value.
An event is called to get the value for a template variable. It does not contain loops or conditionals, but parametrized
templates are possible.
The unit also contains TFPCustomTemplate and its descendant TFPTemplate. Which is a basic implementation that uses the template parser to substitute variables in a text.
Classes and records
ETemplateParser | class | Exception for template parser errors. |
TFPCustomTemplate | class | Base class for templates. |
TFPTemplate | class | Template component. |
TTemplateParser | class | A class to parse templates. |
Types
TGetParamEvent | procedure type | Event to get a value for a template variable. |
TParseDelimiter | type | Type for a delimiter string. |
TReplaceTagEvent | procedure type | Event to replace a tag. |
Constants
DefaultParseDepth | constant | Default maximum recursion depth for parsing. |
MaxDelimLength | constant | Maximum length for a delimiter string. |
Variables
DefaultEndDelimiter | variable | Default end delimiter for a template variable. |
DefaultParamEndDelimiter | variable | Default end delimiter for a template variable parameter. |
DefaultParamStartDelimiter | variable | Default start delimiter for a template variable parameter. |
DefaultParamValueSeparator | variable | Default separator for a template variable parameter and its value. |
DefaultStartDelimiter | variable | Default start delimiter for a template variable. |
MaxParseDepth | variable | Maximum recursion depth for parsing. |
Topics
Basic Template Usage | topic | Basic usage of the template parser |
Parametrized Template Usage | topic | Using templates with parameters |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
