This is primarily used to replace the StringBuffer class, as a way for the TemplateEngine to store the data for a specific region within the parse data that constitutes a desired value. The methods are not synchronized so it enables the characters to be taken quicker than the string buffer class.
Exemple #1
0
 /// <summary>
 /// This will add a <c>Template</c> to the end of this.
 /// The buffer will not overflow with repeated uses of the
 /// <c>append</c>, it uses an <c>ensureCapacity</c>
 /// method which will allow the buffer to dynamically grow in
 /// size to accomodate large <c>Template</c> objects.
 /// </summary>
 /// <param name="text">
 /// the <c>Template</c> to be appended
 /// </param>
 /// <param name="off">
 /// the read offset for the <c>Template</c>
 /// </param>
 /// <param name="len">
 /// the number of characters to append to this
 /// </param>
 public void Append(Template text, int off, int len) {
    Append(text.buf, off, len);
 }
 /// <summary>
 /// Constructor for the <c>TemplateEngine</c> object. This is
 /// used to create a parsing buffer, which can be used to replace
 /// filter variable names with their corrosponding values.
 /// </summary>
 /// <param name="filter">
 /// this is the filter used to provide replacements
 /// </param>
 public TemplateEngine(Filter filter) {
    this.source = new Template();
    this.name = new Template();
    this.text = new Template();
    this.filter = filter;
 }
Exemple #3
0
 /// <summary>
 /// This will add a <c>Template</c> to the end of this.
 /// The buffer will not overflow with repeated uses of the
 /// <c>append</c>, it uses an <c>ensureCapacity</c>
 /// method which will allow the buffer to dynamically grow in
 /// size to accomodate large <c>Template</c> objects.
 /// </summary>
 /// <param name="text">
 /// the <c>Template</c> to be appended
 /// </param>
 public void Append(Template text) {
    Append(text.buf, 0, text.count);
 }
 /// <summary>
 /// This will replace the accumulated for an system variable
 /// name with the value of that system variable. If a value
 /// does not exist for the variable name, then the name is put
 /// into the value so that the value remains unmodified.
 /// </summary>
 /// <param name="name">
 /// this is the name of the system variable
 /// </param>
 public void Replace(Template name) {
    Replace(name.ToString());
 }