You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
512 B
27 lines
512 B
2 years ago
|
/*
|
||
|
DynAPI Distribution
|
||
|
StringBuffer Class
|
||
|
|
||
|
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
|
||
|
|
||
|
*/
|
||
|
|
||
|
function StringBuffer(){
|
||
|
this.buffer=[];
|
||
|
};
|
||
|
var p = StringBuffer.prototype;
|
||
|
p.add=function(src){
|
||
|
this.buffer[this.buffer.length]=src;
|
||
|
};
|
||
|
p.flush=function(){
|
||
|
this.buffer.length=0;
|
||
|
};
|
||
|
p.getLength=function(){
|
||
|
return this.buffer.join('').length;
|
||
|
};
|
||
|
p.toString=function(delim){
|
||
|
return this.buffer.join(delim||'');
|
||
|
};
|
||
|
|
||
|
// More features can be added such as indexOf(), charAt(), etc
|