Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 56x 56x 56x 56x 56x 56x 26x 26x 26x 13x 13x 13x 2x 13x 11x 13x 13x 13x 13x 2x 13x 11x 13x 52x 56x | "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Bucket_1 = __importDefault(require("./Bucket"));
exports.LocalizedTextLocale = 0x01;
exports.LocalizedTextText = 0x02;
// https://reference.opcfoundation.org/v104/Core/docs/Part6/5.2.2/#5.2.2.14
class LocalizedText {
constructor(options) {
var _a, _b, _c, _d, _e, _f;
this.EncodingMask = (_b = (_a = options) === null || _a === void 0 ? void 0 : _a.EncodingMask, (_b !== null && _b !== void 0 ? _b : 0));
this.Locale = (_d = (_c = options) === null || _c === void 0 ? void 0 : _c.Locale, (_d !== null && _d !== void 0 ? _d : ''));
this.Text = (_f = (_e = options) === null || _e === void 0 ? void 0 : _e.Text, (_f !== null && _f !== void 0 ? _f : ''));
}
encode() {
const bucket = new Bucket_1.default();
bucket.writeUint8(this.EncodingMask);
if (this.has(exports.LocalizedTextLocale)) {
bucket.writeString(this.Locale);
}
if (this.has(exports.LocalizedTextText)) {
bucket.writeString(this.Text);
}
return bucket.bytes;
}
decode(b, position) {
const bucket = new Bucket_1.default(b, position);
this.EncodingMask = bucket.readUint8();
if (this.has(exports.LocalizedTextLocale)) {
this.Locale = bucket.readString();
}
if (this.has(exports.LocalizedTextText)) {
this.Text = bucket.readString();
}
return bucket.position;
}
has(mask) {
return (this.EncodingMask & mask) === mask;
}
}
exports.default = LocalizedText;
|