#include "SectionStream.h"
#include "TemplateStream.h"
#include <Data/BitSet.h>
#include "../Format.h"
Include dependency graph for SectionTemplate.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
class | SectionTemplate |
Provides enhanced template tag processing for use with a SectionStream. More... | |
Macros | |
#define | SECTION_TEMPLATE_COMMAND_MAP(XX) |
Command map. More... | |
#define | SECTION_TEMPLATE_FIELD_MAP(XX) |
#define | XX(name, comment) name, |
#define | XX(name, comment) name, |
Macro Definition Documentation
◆ SECTION_TEMPLATE_COMMAND_MAP
#define SECTION_TEMPLATE_COMMAND_MAP | ( | XX | ) |
Value:
XX(Qas_int, "{!int:A} Output A as integer") \
XX(Qas_float, "{!float:A} Output A as float") \
XX(Qas_string, "{!string:A} Output A as quoted string") \
XX(Qmime_type, "{!mime_type:A} Get MIME type string for a filename") \
XX(Qreplace, "{!replace:A:B:C} Copy of A with all occurrences of B replaced with C") \
XX(Qlength, "{!length:A} Number of characters in A") \
XX(Qpad, \
"{!pad:A:B:C} Copy of A padded to at least B characters with C (default is space). Use -ve B to left-pad. C") \
XX(Qrepeat, "{!repeat:A:B} Repeat A, number of iterations is B") \
XX(Qkb, "{!kb:A} Convert A to KB") \
XX(Qifdef, "{!ifdef:A} emit block if A is not zero-length") \
XX(Qifndef, "{!ifdef:A} emit block if A is zero-length") \
XX(Qifeq, "{!ifeq:A:B} emit block if A == B") \
XX(Qifneq, "{!ifneq:A:B} emit block if A != B") \
XX(Qifgt, "{!ifgt:A:B} emit block if A > B") \
XX(Qiflt, "{!iflt:A:B} emit block if A < B") \
XX(Qifge, "{!ifge:A:B} emit block if A >= B") \
XX(Qifle, "{!ifle:A:B} emit block if A <= B") \
XX(Qifbtw, "{!ifbtw:A:B:C} emit block if B <= A <= C") \
XX(Qifin, "{!ifin:A:B} emit block if A contains B") \
XX(Qifnin, "{!ifin:A:B} emit block if A does not contain B") \
XX(Qelse, "{!else}") \
XX(Qendif, "{!endif}") \
XX(Qadd, "{!add:A:B} A + B") \
XX(Qsub, "{!sub:A:B} A - B") \
XX(Qgoto, "{!goto:A} move to section A") \
XX(Qcount, "{!count:A} emit number of records in section A") \
XX(Qindex, "{!index:A} emit current record index for section A")
Command map.
Commands may have zero or more arguments, which may be: Number: starts with a digit String: "..." expression: {...}
Anything else is treated as a variable name. Separator is :
Conditional if/else/endif statements may be nested.
- Note
- Command tags are prefixed with 'Q' to allow use of reserved words in the Command enumeration. This represents the ! prefix in actual use.
◆ SECTION_TEMPLATE_FIELD_MAP
#define SECTION_TEMPLATE_FIELD_MAP | ( | XX | ) |
Value:
XX(section, "{$section} Current section index") \
XX(record, "{$record} Current record index")
◆ XX [1/2]
#define XX | ( | name, | |
comment | |||
) | name, |
◆ XX [2/2]
#define XX | ( | name, | |
comment | |||
) | name, |