/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { Base, markType } from "./type";
import { StringBuilder } from "./StringBuilder";
/**
 * @hidden
 */
var CodeGeneratingCodeWriter = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CodeGeneratingCodeWriter, _super);
    function CodeGeneratingCodeWriter(a) {
        var _this = _super.call(this) || this;
        _this.e = new StringBuilder(0);
        _this.c = 0;
        _this.b = true;
        _this.a = null;
        _this.a = a;
        return _this;
    }
    CodeGeneratingCodeWriter.prototype.h = function () {
        this.c++;
    };
    CodeGeneratingCodeWriter.prototype.f = function () {
        this.c--;
    };
    CodeGeneratingCodeWriter.prototype.j = function (a) {
        this.g();
        this.e.l(a);
    };
    CodeGeneratingCodeWriter.prototype.g = function () {
        if (this.b) {
            this.b = false;
            for (var a = 0; a < this.c; a++) {
                if (this.a.useSpacesForIndent) {
                    for (var b = 0; b < this.a.indentSpaces; b++) {
                        this.e.l(" ");
                    }
                }
                else {
                    this.e.l("\t");
                }
            }
        }
    };
    CodeGeneratingCodeWriter.prototype.k = function (a) {
        this.g();
        this.e.u(a);
        this.b = true;
    };
    CodeGeneratingCodeWriter.prototype.i = function () {
        this.g();
        this.e.t();
        this.b = true;
    };
    CodeGeneratingCodeWriter.prototype.toString = function () {
        return this.e.toString();
    };
    CodeGeneratingCodeWriter.$t = markType(CodeGeneratingCodeWriter, 'CodeGeneratingCodeWriter');
    return CodeGeneratingCodeWriter;
}(Base));
export { CodeGeneratingCodeWriter };
