Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function decode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: BinaryStream): void {
const encodingMask = decodeByte(stream);
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
}
// read localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
diagnosticInfo.localizedText = decodeInt32(stream);
}
// read additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
diagnosticInfo.additionalInfo = decodeString(stream);
}
// read inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
diagnosticInfo.innerStatusCode = decodeStatusCode(stream);
}
// read inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceURI, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
tracer.trace("member", "locale", diagnosticInfo.locale, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
diagnosticInfo.localizedText = decodeInt32(stream);
tracer.trace("member", "localizedText", diagnosticInfo.localizedText, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
diagnosticInfo.additionalInfo = decodeString(stream);
tracer.trace("member", "additionalInfo", diagnosticInfo.additionalInfo, cursorBefore, stream.length, "String");
cursorBefore = stream.length;
}
// read inner status code
const encodingMask = decodeByte(stream);
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
tracer.encoding_byte(encodingMask, DiagnosticInfo_EncodingByte, cursorBefore, stream.length);
cursorBefore = stream.length;
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceURI, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
tracer.trace("member", "locale", diagnosticInfo.locale, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
diagnosticInfo.localizedText = decodeInt32(stream);
tracer.trace("member", "localizedText", diagnosticInfo.localizedText, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read additional info
function decode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: BinaryStream): void {
const encodingMask = decodeByte(stream);
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
}
// read localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
diagnosticInfo.localizedText = decodeInt32(stream);
}
// read additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
diagnosticInfo.additionalInfo = decodeString(stream);
}
// read inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
diagnosticInfo.innerStatusCode = decodeStatusCode(stream);
const tracer = options.tracer;
tracer.trace("start", options.name + "(" + "DiagnosticInfo" + ")", stream.length, stream.length);
let cursorBefore = stream.length;
const encodingMask = decodeByte(stream);
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
tracer.encoding_byte(encodingMask, DiagnosticInfo_EncodingByte, cursorBefore, stream.length);
cursorBefore = stream.length;
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceURI, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
tracer.trace("member", "locale", diagnosticInfo.locale, cursorBefore, stream.length, "Int32");
cursorBefore = stream.length;
}
// read localized text
// read symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
diagnosticInfo.symbolicId = ec.decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
diagnosticInfo.namespaceUri = ec.decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceUri, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
diagnosticInfo.locale = ec.decodeInt32(stream);
tracer.trace("member", "locale", diagnosticInfo.locale, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read localized text
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.LocalizedText)) {
diagnosticInfo.localizedText = ec.decodeInt32(stream);
tracer.trace("member", "localizedText", diagnosticInfo.localizedText, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read additional info
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.AdditionalInfo)) {
diagnosticInfo.additionalInfo = ec.decodeString(stream);
tracer.trace("member", "additionalInfo", diagnosticInfo.additionalInfo, cursor_before, stream.length, "String");
cursor_before = stream.length;
}
// read inner status code
// read symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
diagnosticInfo.symbolicId = decodeInt32(stream);
}
// read namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
diagnosticInfo.namespaceURI = decodeInt32(stream);
}
// read locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
diagnosticInfo.locale = decodeInt32(stream);
}
// read localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
diagnosticInfo.localizedText = decodeInt32(stream);
}
// read additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
diagnosticInfo.additionalInfo = decodeString(stream);
}
// read inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
diagnosticInfo.innerStatusCode = decodeStatusCode(stream);
}
// read inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
if (diagnosticInfo.innerDiagnosticInfo) {
diagnosticInfo.innerDiagnosticInfo.decode(stream);
}
}
decode: function (diagnosticInfo, stream, options) {
const encoding_mask = ec.decodeByte(stream);
// read symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
diagnosticInfo.symbolicId = ec.decodeInt32(stream);
}
// read namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
diagnosticInfo.namespaceUri = ec.decodeInt32(stream);
}
// read locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
diagnosticInfo.locale = ec.decodeInt32(stream);
}
// read localized text
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.LocalizedText)) {
diagnosticInfo.localizedText = ec.decodeInt32(stream);
}
// read additional info
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.AdditionalInfo)) {
diagnosticInfo.additionalInfo = ec.decodeString(stream);
}
// read inner status code
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.InnerStatusCode)) {
diagnosticInfo.innerStatusCode = ec.decodeStatusCode(stream);
}
// read inner status code
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.InnerDiagnosticInfo)) {
const tracer = options.tracer;
tracer.trace("start", options.name + "(" + "DiagnosticInfo" + ")", stream.length, stream.length);
let cursor_before = stream.length;
const encoding_mask = ec.decodeByte(stream);
tracer.trace("member", "encodingByte", "0x" + encoding_mask.toString(16), cursor_before, stream.length, "Mask");
tracer.encoding_byte(encoding_mask,DiagnosticInfo_EncodingByte,cursor_before,stream.length);
cursor_before = stream.length;
// read symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
diagnosticInfo.symbolicId = ec.decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
diagnosticInfo.namespaceUri = ec.decodeInt32(stream);
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceUri, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
diagnosticInfo.locale = ec.decodeInt32(stream);
tracer.trace("member", "locale", diagnosticInfo.locale, cursor_before, stream.length, "Int32");
cursor_before = stream.length;
}
// read localized text