/*
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 { Base, markType } from "./type";
import { StringBuilder } from "./StringBuilder";
/**
 * @hidden
 */
export let CodeGeneratingCodeWriter = /*@__PURE__*/ (() => {
    class CodeGeneratingCodeWriter extends Base {
        constructor(a) {
            super();
            this.e = new StringBuilder(0);
            this.c = 0;
            this.b = true;
            this.a = null;
            this.a = a;
        }
        h() {
            this.c++;
        }
        f() {
            this.c--;
        }
        j(a) {
            this.g();
            this.e.l(a);
        }
        g() {
            if (this.b) {
                this.b = false;
                for (let a = 0; a < this.c; a++) {
                    if (this.a.useSpacesForIndent) {
                        for (let b = 0; b < this.a.indentSpaces; b++) {
                            this.e.l(" ");
                        }
                    }
                    else {
                        this.e.l("\t");
                    }
                }
            }
        }
        k(a) {
            this.g();
            this.e.u(a);
            this.b = true;
        }
        i() {
            this.g();
            this.e.t();
            this.b = true;
        }
        toString() {
            return this.e.toString();
        }
    }
    CodeGeneratingCodeWriter.$t = markType(CodeGeneratingCodeWriter, 'CodeGeneratingCodeWriter');
    return CodeGeneratingCodeWriter;
})();
