Append() публичный Метод

This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.
public Append ( String str ) : void
str String /// the String to be appended to this ///
Результат void
Пример #1
0
 /// <summary>
 /// This method is used to append the provided text and then it
 /// converts the buffered text to return the corrosponding text.
 /// The contents of the buffer remain unchanged after the value
 /// is buffered. It must be cleared if used as replacement only.
 /// </summary>
 /// <param name="value">
 /// this is the value to append to the buffer
 /// </param>
 /// <returns>
 /// returns the value of the buffer after the append
 /// </returns>
 public String Process(String value)
 {
     if (value.indexOf('$') < 0)
     {
         return(value);
     }
     try {
         source.Append(value);
         Parse();
         return(text.ToString());
     }finally {
         Clear();
     }
 }
Пример #2
0
 /// <summary>
 /// This method is used to extract text from the property value
 /// that matches the pattern "${ *TEXT }". Such patterns within
 /// the properties file are considered to be system
 /// variables, this will replace instances of the text pattern
 /// with the matching system variable, if a matching
 /// variable does not exist the value remains unmodified.
 /// </summary>
 public void Name()
 {
     while (off < source.count)
     {
         char next = source.buf[off++];
         if (next == '}')
         {
             Replace();
             break;
         }
         else
         {
             name.Append(next);
         }
     }
     if (name.Length() > 0)
     {
         text.Append("${");
         text.Append(name);
     }
 }
Пример #3
0
 /// <summary>
 /// This extracts the value from the Java properties text. This
 /// will basically ready any text up to the first occurance of
 /// an equal of a terminal. If a terminal character is read
 /// this returns without adding the terminal to the value.
 /// </summary>
 public void Parse()
 {
     while (off < source.count)
     {
         char next = source.buf[off++];
         if (next == '$')
         {
             if (off < source.count)
             {
                 if (source.buf[off++] == '{')
                 {
                     Name();
                     continue;
                 }
                 else
                 {
                     off--;
                 }
             }
         }
         text.Append(next);
     }
 }