OpenPetra
Free Administration Software for Non-Profits
|
this class helps with template scripts and other text files More...
Public Member Functions | |
ProcessTemplate (string AFullPath=null) | |
constructor, open template from file More... | |
void | AddSnippetsFromOtherFile (string AFilePath) |
add snippets from another template file (eg. for writing datasets, we want to reuse the table template for custom tables) More... | |
ProcessTemplate | GetSnippet (string ASnippetName) |
get the specified snippet, in a new Template More... | |
void | InsertSnippet (string ACodeletName, ProcessTemplate ASnippet) |
insert the snippet into the current template, into the given codelet More... | |
void | InsertSnippet (string ACodeletName, ProcessTemplate ASnippet, string ASeparator) |
insert the snippet into the current template, into the given codelet. use separator to separate from previous items inserted into that codelet More... | |
void | InsertSnippetPrepend (string ACodeletName, ProcessTemplate ASnippet) |
insert the snippet into the current template, into the given codelet. add new text in front of the text that has already been added to the codelet More... | |
Boolean | CheckTemplateCompletion (StringBuilder s) |
check if all placeholders have been replaced in the template; ignore IFDEF More... | |
void | ProcessIFDEFs (ref StringBuilder sb) |
remove all ifdefs that are not defined, or activate them More... | |
void | SetCodeLetPostfix (string APostfix) |
set the postfix for codelets. this helps to distinguish codelets when nesting codelets More... | |
void | AddToCodelet (string APlaceholder, string ACodelet) |
add code to existing code that will be replaced later More... | |
string | AddSeparatorToCodelet (string APlaceholder, string ASeparator) |
add separator to codelet at the end of the previous row More... | |
void | AddToCodeletPrepend (string APlaceholder, string ACodelet) |
void | AddToCodeletPrepend (string APlaceholder, string ACodelet, bool AAllowDuplicates) |
void | AddToCodelet (string APlaceholder, string ACodelet, bool AAddDuplicates) |
add code to existing code that will be replaced later More... | |
void | SetCodelet (string APlaceholder, string ACodelet) |
create a new codelet, overwrites existing one More... | |
void | SetCodeletComment (string APlaceholder, string AMultiLineComment) |
special way of splitting a multiline comment into several lines with comment slashes More... | |
void | ReplacePlaceHolder (string APlaceholder, string AValue, string ADefault) |
add replacement to the list of codelets More... | |
void | ReplacePlaceHolder (string APlaceholder, string AValue) |
replace a placeholder with an actual value. overload with empty default. More... | |
Boolean | ReplaceRegion (string regionName, string content) |
replace a region with new content More... | |
Boolean | processTemplateParameters (XmlNode curNode) |
insert parameters into placeholders More... | |
void | BeautifyCode (ref StringBuilder s) |
clean up the code, remove spaces, too many empty lines More... | |
Boolean | FinishWriting (string AXAMLFilename, string ADestFileExtension, Boolean ACheckTemplateCompletion) |
write the content to a file. deal with conditional defines etc. More... | |
string | FinishWriting (Boolean ACheckTemplateCompletion) |
return the snippet as a string, instead of writing to file More... | |
Static Public Member Functions | |
static string | LoadEmptyFileComment (string ATemplatePath) |
load the license and copyright text for the file header More... | |
Public Attributes | |
StringBuilder | FTemplateCode = new StringBuilder() |
the template More... | |
String | FDestinationFile = "" |
the name of the file to write to More... | |
SortedList< string, StringBuilder > | FCodelets = new SortedList <string, StringBuilder>() |
temporary strings to store code into that will later each be inserted into a placeholder More... | |
SortedList< string, string > | FSnippets = new SortedList <string, string>() |
snippets are smaller pieces of template code More... | |
String | FCodeletPostfix = "" |
this helps to distinguish codelets when nesting codelets More... | |
Protected Member Functions | |
void | ReplaceCodelets () |
insert the codelets into the template that have been collected until now More... | |
this class helps with template scripts and other text files
|
inline |
constructor, open template from file
AFullPath |
|
inline |
add separator to codelet at the end of the previous row
|
inline |
add snippets from another template file (eg. for writing datasets, we want to reuse the table template for custom tables)
AFilePath |
|
inline |
add code to existing code that will be replaced later
|
inline |
add code to existing code that will be replaced later
APlaceholder | |
ACodelet | |
AAddDuplicates |
|
inline |
add code to existing code that will be replaced later. the new code is added before the existing code. this overload allows duplicates to be added
|
inline |
add code to existing code that will be replaced later. the new code is added before the existing code
|
inline |
clean up the code, remove spaces, too many empty lines
s |
|
inline |
check if all placeholders have been replaced in the template; ignore IFDEF
|
inline |
return the snippet as a string, instead of writing to file
|
inline |
write the content to a file. deal with conditional defines etc.
AXAMLFilename | |
ADestFileExtension | |
ACheckTemplateCompletion |
|
inline |
get the specified snippet, in a new Template
ASnippetName |
|
inline |
insert the snippet into the current template, into the given codelet
ACodeletName | |
ASnippet |
|
inline |
insert the snippet into the current template, into the given codelet. use separator to separate from previous items inserted into that codelet
ACodeletName | |
ASnippet | |
ASeparator |
|
inline |
insert the snippet into the current template, into the given codelet. add new text in front of the text that has already been added to the codelet
ACodeletName | |
ASnippet |
|
inlinestatic |
load the license and copyright text for the file header
ATemplatePath |
|
inline |
remove all ifdefs that are not defined, or activate them
|
inline |
insert parameters into placeholders
curNode |
|
inlineprotected |
insert the codelets into the template that have been collected until now
|
inline |
replace a placeholder with an actual value. overload with empty default.
APlaceholder | |
AValue |
|
inline |
add replacement to the list of codelets
APlaceholder | |
AValue | |
ADefault |
|
inline |
replace a region with new content
regionName | |
content |
|
inline |
create a new codelet, overwrites existing one
|
inline |
special way of splitting a multiline comment into several lines with comment slashes
|
inline |
set the postfix for codelets. this helps to distinguish codelets when nesting codelets
APostfix |
String Ict.Common.IO.ProcessTemplate.FCodeletPostfix = "" |
this helps to distinguish codelets when nesting codelets
SortedList<string, StringBuilder> Ict.Common.IO.ProcessTemplate.FCodelets = new SortedList <string, StringBuilder>() |
temporary strings to store code into that will later each be inserted into a placeholder
String Ict.Common.IO.ProcessTemplate.FDestinationFile = "" |
the name of the file to write to
SortedList<string, string> Ict.Common.IO.ProcessTemplate.FSnippets = new SortedList <string, string>() |
snippets are smaller pieces of template code
StringBuilder Ict.Common.IO.ProcessTemplate.FTemplateCode = new StringBuilder() |
the template