Subversion Repositories wimsdev

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.         DynAPI Distribution
  3.         StringBuffer Class
  4.  
  5.         The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
  6.  
  7. */
  8.  
  9. function StringBuffer(){
  10.         this.buffer=[];
  11. };
  12. var p = StringBuffer.prototype;
  13. p.add=function(src){
  14.         this.buffer[this.buffer.length]=src;
  15. };
  16. p.flush=function(){
  17.         this.buffer.length=0;
  18. };
  19. p.getLength=function(){
  20.         return this.buffer.join('').length;
  21. };
  22. p.toString=function(delim){
  23.         return this.buffer.join(delim||'');
  24. };
  25.  
  26. // More features can be added such as indexOf(), charAt(), etc
  27.