Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
encode: function (diagnosticInfo, stream) {
const encoding_mask = getDiagnosticInfoEncodingByte(diagnosticInfo);
// write encoding byte
ec.encodeByte(encoding_mask, stream);
// write symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
ec.encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
ec.encodeInt32(diagnosticInfo.namespaceUri, stream);
}
// write locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
ec.encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.LocalizedText)) {
ec.encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.AdditionalInfo)) {
ec.encodeString(diagnosticInfo.additionalInfo, stream);
}
// write inner status code
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.InnerStatusCode)) {
ec.encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
function encode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: OutputBinaryStream): void {
const encodingMask = getDiagnosticInfoEncodingByte(diagnosticInfo);
// write encoding byte
encodeByte(encodingMask, stream);
// write symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
encodeInt32(diagnosticInfo.namespaceURI, stream);
}
// write locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
encodeString(diagnosticInfo.additionalInfo, stream);
const encodingMask = getDiagnosticInfoEncodingByte(diagnosticInfo);
// write encoding byte
encodeByte(encodingMask, stream);
// write symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
encodeInt32(diagnosticInfo.namespaceURI, stream);
}
// write locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
encodeString(diagnosticInfo.additionalInfo, stream);
}
// write inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
}
// write innerDiagnosticInfo
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
assert(diagnosticInfo.innerDiagnosticInfo !== null, "missing innerDiagnosticInfo");
// write symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
encodeInt32(diagnosticInfo.namespaceURI, stream);
}
// write locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
encodeString(diagnosticInfo.additionalInfo, stream);
}
// write inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
}
// write innerDiagnosticInfo
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
assert(diagnosticInfo.innerDiagnosticInfo !== null, "missing innerDiagnosticInfo");
if (diagnosticInfo.innerDiagnosticInfo) {
encode_DiagnosticInfo(diagnosticInfo.innerDiagnosticInfo, stream);
}
}
function encode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: OutputBinaryStream): void {
const encodingMask = getDiagnosticInfoEncodingByte(diagnosticInfo);
// write encoding byte
encodeByte(encodingMask, stream);
// write symbolic id
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
encodeInt32(diagnosticInfo.namespaceURI, stream);
}
// write locale
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
encodeString(diagnosticInfo.additionalInfo, stream);
}
// write inner status code
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
// write symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
ec.encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
ec.encodeInt32(diagnosticInfo.namespaceUri, stream);
}
// write locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
ec.encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.LocalizedText)) {
ec.encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.AdditionalInfo)) {
ec.encodeString(diagnosticInfo.additionalInfo, stream);
}
// write inner status code
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.InnerStatusCode)) {
ec.encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
}
// write innerDiagnosticInfo
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.InnerDiagnosticInfo)) {
assert(diagnosticInfo.innerDiagnosticInfo !== null && "missing innerDiagnosticInfo");
diagnosticInfo.innerDiagnosticInfo.encode(stream);
}
},
encode: function (diagnosticInfo, stream) {
const encoding_mask = getDiagnosticInfoEncodingByte(diagnosticInfo);
// write encoding byte
ec.encodeByte(encoding_mask, stream);
// write symbolic id
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.SymbolicId)) {
ec.encodeInt32(diagnosticInfo.symbolicId, stream);
}
// write namespace uri
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.NamespaceUri)) {
ec.encodeInt32(diagnosticInfo.namespaceUri, stream);
}
// write locale
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.Locale)) {
ec.encodeInt32(diagnosticInfo.locale, stream);
}
// write localized text
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.LocalizedText)) {
ec.encodeInt32(diagnosticInfo.localizedText, stream);
}
// write additional info
if (check_flag(encoding_mask, DiagnosticInfo_EncodingByte.AdditionalInfo)) {
ec.encodeString(diagnosticInfo.additionalInfo, stream);