@abaplint/core
Version:
abaplint - Core API
66 lines • 2.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MIMEObject = void 0;
const _abstract_object_1 = require("./_abstract_object");
class MIMEObject extends _abstract_object_1.AbstractObject {
getType() {
return "SMIM";
}
getURL() {
var _a;
this.parse();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.URL;
}
getClass() {
var _a;
this.parse();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.CLASS;
}
isFolder() {
var _a;
return ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.FOLDER) === "X";
}
getAllowedNaming() {
return {
maxLength: 32,
allowNamespace: false,
};
}
getDataFile() {
const main = this.getXMLFile();
for (const f of this.getFiles()) {
if (f.getFilename() !== (main === null || main === void 0 ? void 0 : main.getFilename())) {
return f;
}
}
return undefined;
}
setDirty() {
this.parsedXML = undefined;
super.setDirty();
}
getDescription() {
// this object type does not have a description
return undefined;
}
parse() {
if (this.parsedXML) {
return { updated: false, runtime: 0 };
}
const start = Date.now();
this.parsedXML = {};
const parsed = super.parseRaw2();
if (parsed === undefined
|| parsed.abapGit === undefined
|| parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
return { updated: false, runtime: 0 };
}
this.parsedXML.URL = parsed.abapGit["asx:abap"]["asx:values"].URL;
this.parsedXML.CLASS = parsed.abapGit["asx:abap"]["asx:values"].CLASS;
this.parsedXML.FOLDER = parsed.abapGit["asx:abap"]["asx:values"].FOLDER;
const end = Date.now();
return { updated: true, runtime: end - start };
}
}
exports.MIMEObject = MIMEObject;
//# sourceMappingURL=mime_object.js.map