import { BooleanOption, EnumOption, StringOption, getOptionValues, } from "../../RendererOptions/index.js";
import { TargetLanguage } from "../../TargetLanguage.js";
import { CPlusPlusRenderer } from "./CPlusPlusRenderer.js";
// FIXME: share with CJSON
const namingStyles = {
    "pascal-case": "pascal",
    "underscore-case": "underscore",
    "camel-case": "camel",
    "upper-underscore-case": "upper-underscore",
    "pascal-case-upper-acronyms": "pascal-upper-acronyms",
    "camel-case-upper-acronyms": "camel-upper-acronyms",
};
export const cPlusPlusOptions = {
    typeSourceStyle: new EnumOption("source-style", "Source code generation type,  whether to generate single or multiple source files", {
        "single-source": true,
        "multi-source": false,
    }, "single-source", "secondary"),
    includeLocation: new EnumOption("include-location", "Whether json.hpp is to be located globally or locally", {
        "local-include": true,
        "global-include": false,
    }, "local-include", "secondary"),
    codeFormat: new EnumOption("code-format", "Generate classes with getters/setters, instead of structs", {
        "with-struct": false,
        "with-getter-setter": true,
    }, "with-getter-setter"),
    wstring: new EnumOption("wstring", "Store strings using Utf-16 std::wstring, rather than Utf-8 std::string", {
        "use-string": false,
        "use-wstring": true,
    }, "use-string"),
    westConst: new EnumOption("const-style", "Put const to the left/west (const T) or right/east (T const)", {
        "west-const": true,
        "east-const": false,
    }, "west-const"),
    justTypes: new BooleanOption("just-types", "Plain types only", false),
    namespace: new StringOption("namespace", "Name of the generated namespace(s)", "NAME", "quicktype"),
    enumType: new StringOption("enum-type", "Type of enum class", "NAME", "int", "secondary"),
    typeNamingStyle: new EnumOption("type-style", "Naming style for types", namingStyles, "pascal-case"),
    memberNamingStyle: new EnumOption("member-style", "Naming style for members", namingStyles, "underscore-case"),
    enumeratorNamingStyle: new EnumOption("enumerator-style", "Naming style for enumerators", namingStyles, "upper-underscore-case"),
    boost: new BooleanOption("boost", "Require a dependency on boost. Without boost, C++17 is required", true),
    hideNullOptional: new BooleanOption("hide-null-optional", "Hide null value for optional field", false),
};
export const cPlusPlusLanguageConfig = {
    displayName: "C++",
    names: ["c++", "cpp", "cplusplus"],
    extension: "cpp",
};
export class CPlusPlusTargetLanguage extends TargetLanguage {
    constructor() {
        super(cPlusPlusLanguageConfig);
    }
    getOptions() {
        return cPlusPlusOptions;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        return new CPlusPlusRenderer(this, renderContext, getOptionValues(cPlusPlusOptions, untypedOptionValues));
    }
}
