Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv10676/include
Modified Files:
MessageTemplate.h
Log Message:
added possibility to set the message headers from templates
Index: MessageTemplate.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageTemplate.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- MessageTemplate.h 13 Apr 2001 19:56:51 -0000 1.10
+++ MessageTemplate.h 4 Mar 2002 20:53:27 -0000 1.11
@@ -36,10 +36,15 @@
The "category" is one of the elements of gs_templateVarCategories elements.
The "name"s are in gs_templateVarNames array. Both of them are "words", i.e.
- are sequences of alphabetic characters.
-
- The arguments are optional and if they are present are a comma-separated
- list of words (i.e. alphabetic characters only are allowed). For example,
- the following will insert the quoted contents of the file after asking the
- user for a file name default to foo.bar: $(file:foo.bar?ASK,QUOTE)
+ are sequences of alphabetic characters. The category also may be implied by
+ using the special brackets: $`...` implies the category "cmd", i.e. executes
+ the command specified inside the single quotes and $<...< implies the
+ category file (rationale: think about the Unix shell).
+
+ The arguments are optional and if they are present are either a
+ comma-separated list of words (i.e. alphabetic characters only are allowed)
+ or another variable expansion. For example, the following will insert
+ the quoted contents of the file after asking the user for a file name
+ default to foo.bar: $(file:foo.bar?ASK,QUOTE) and this example will set the
+ value of the specified header as expected: $(header:X-UnixName?$`whoami`)
The optional tail {+|-|=}<number> may be used to justify the value: + aligns
@@ -161,6 +166,19 @@
private:
+ // parse an expression starting with '$'
+ bool ExpandTemplate(const char **ppc, String *value) const;
+
MessageTemplateVarExpander *m_expander;
- String m_templateText, m_filename;
+
+ // the entire template text and the name of the file we had read it from
+ String m_templateText,
+ m_filename;
+
+ // the current line number while parsing
+ size_t m_nLine;
+
+ // start of the current line (for calculating the offset in line for the
+ // error messages)
+ const char *m_pStartOfLine;
};
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates