{"size": 738, "ext": "js", "max_stars_repo_path": "src/StringBuffer.js", "max_stars_repo_name": "heapsource/fire", "max_stars_repo_stars_event_min_datetime": "2018-01-31T15:15:11.000Z", "max_stars_repo_stars_event_max_datetime": "2018-02-01T01:23:49.000Z", "max_issues_repo_path": "src/StringBuffer.js", "max_issues_repo_name": "heapsource/fire", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/StringBuffer.js", "max_forks_repo_name": "heapsource/fire", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.45, "max_line_length": 64, "alphanum_fraction": 0.6991869919}

var StringBuffer = function() {
	this.str = ""
	this.indentLevel = 0;
	this.indentStep = 2
}
StringBuffer.prototype.indent = function() {
	this.indentLevel++
}

StringBuffer.prototype.unindent = function() {
	if(this.unindentLevel == 0) return;
	this.indentLevel--
}

StringBuffer.prototype.createIndent = function() {
	var s = ""
	var max = this.indentLevel * this.indentStep;
	for(var i = 0;i < max; i++) {
		s+=" "
	}
	return s
}

StringBuffer.prototype.toString = function() {
	return this.str
}

StringBuffer.prototype.write = function(str, finishedCallback) {
	this.str+=str
}

StringBuffer.prototype.writeLine = function(str) {
	this.write(this.createIndent())
	this.write(str)
	this.write("\n")
}

module.exports = StringBuffer;
