25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.CppDefinition = void 0;
|
|
const Texts_1 = require("../library/Texts");
|
|
class CppDefinition {
|
|
static createVariation(cppDefinition, map) {
|
|
let variation = new CppDefinition();
|
|
variation.class = Texts_1.Texts.replaceAll(cppDefinition.class, map);
|
|
variation.includes = Texts_1.Texts.replaceAllIn(cppDefinition.includes, map);
|
|
variation.forwards = Texts_1.Texts.replaceAllIn(cppDefinition.forwards, map);
|
|
variation.public = CppDefinition.applyVariationOnAll(cppDefinition.public, map);
|
|
variation.protected = CppDefinition.applyVariationOnAll(cppDefinition.protected, map);
|
|
return variation;
|
|
}
|
|
static applyVariationOnAll(obj, map) {
|
|
if (obj === null || obj === undefined) {
|
|
return obj;
|
|
}
|
|
let jsonValue = JSON.stringify(obj);
|
|
jsonValue = Texts_1.Texts.replaceAll(jsonValue, map);
|
|
return JSON.parse(jsonValue);
|
|
}
|
|
}
|
|
exports.CppDefinition = CppDefinition;
|
|
//# sourceMappingURL=CppDefinition.js.map
|