node-opcua-data-model 2.55.0 → 2.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.yml +10 -10
- package/LICENSE +20 -20
- package/dist/_make_flag.d.ts +1 -1
- package/dist/_make_flag.js.map +1 -1
- package/dist/access_level.js.map +1 -1
- package/dist/access_level_ex.d.ts +2 -0
- package/dist/access_level_ex.js +11 -2
- package/dist/access_level_ex.js.map +1 -1
- package/dist/access_restrictions.js.map +1 -1
- package/dist/attributeIds.js.map +1 -1
- package/dist/data_encoding.d.ts +1 -1
- package/dist/data_encoding.js +2 -2
- package/dist/data_encoding.js.map +1 -1
- package/dist/diagnostic_info.d.ts +2 -2
- package/dist/diagnostic_info.js.map +1 -1
- package/dist/localized_text.d.ts +3 -3
- package/dist/localized_text.js.map +1 -1
- package/dist/node_class_mask.js.map +1 -1
- package/dist/nodeclass.js.map +1 -1
- package/dist/permission_flag.js.map +1 -1
- package/dist/qualified_name.js +2 -2
- package/dist/qualified_name.js.map +1 -1
- package/dist/result_mask.js.map +1 -1
- package/dist/write_mask.js +1 -1
- package/dist/write_mask.js.map +1 -1
- package/package.json +11 -9
- package/source/BrowseDirection.ts +41 -41
- package/source/_make_flag.ts +2 -3
- package/source/access_level.ts +18 -13
- package/source/access_level_ex.ts +32 -25
- package/source/access_restrictions.ts +1 -3
- package/source/attributeIds.ts +1 -5
- package/source/data_encoding.ts +23 -23
- package/source/diagnostic_info.ts +362 -361
- package/source/localized_text.ts +189 -188
- package/source/node_class_mask.ts +47 -47
- package/source/nodeclass.ts +23 -23
- package/source/permission_flag.ts +8 -8
- package/source/qualified_name.ts +3 -3
- package/source/result_mask.ts +35 -35
- package/source/time_zone.ts +18 -18
- package/source/write_mask.ts +37 -37
|
@@ -1,361 +1,362 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-data-model
|
|
3
|
-
*/
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
5
|
-
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
-
import {
|
|
7
|
-
BaseUAObject,
|
|
8
|
-
buildStructuredType,
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
public static
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
public
|
|
102
|
-
public
|
|
103
|
-
public
|
|
104
|
-
public
|
|
105
|
-
public
|
|
106
|
-
public
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*
|
|
111
|
-
* @
|
|
112
|
-
* @
|
|
113
|
-
* @
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
127
|
-
this.
|
|
128
|
-
this.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
DiagnosticInfo.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
tracer.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
cursorBefore
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
cursorBefore
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
cursorBefore
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
cursorBefore
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
cursorBefore
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
cursorBefore
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
value
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
//
|
|
361
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
+
import {
|
|
7
|
+
BaseUAObject,
|
|
8
|
+
buildStructuredType,
|
|
9
|
+
DecodeDebugOptions,
|
|
10
|
+
parameters,
|
|
11
|
+
registerSpecialVariantEncoder,
|
|
12
|
+
StructuredTypeSchema
|
|
13
|
+
} from "node-opcua-factory";
|
|
14
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
decodeByte,
|
|
18
|
+
decodeInt32,
|
|
19
|
+
decodeStatusCode,
|
|
20
|
+
decodeString,
|
|
21
|
+
encodeByte,
|
|
22
|
+
encodeInt32,
|
|
23
|
+
encodeStatusCode,
|
|
24
|
+
encodeString,
|
|
25
|
+
Int32,
|
|
26
|
+
UAString
|
|
27
|
+
} from "node-opcua-basic-types";
|
|
28
|
+
import { check_options_correctness_against_schema, initialize_field } from "node-opcua-factory";
|
|
29
|
+
|
|
30
|
+
// --------------------------------------------------------------------------------------------
|
|
31
|
+
export const schemaDiagnosticInfo: StructuredTypeSchema = buildStructuredType({
|
|
32
|
+
name: "DiagnosticInfo",
|
|
33
|
+
|
|
34
|
+
baseType: "BaseUAObject",
|
|
35
|
+
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
name: "namespaceUri",
|
|
39
|
+
|
|
40
|
+
fieldType: "Int32",
|
|
41
|
+
|
|
42
|
+
defaultValue: -1,
|
|
43
|
+
documentation: "The symbolicId is defined within the context of a namespace."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "symbolicId",
|
|
47
|
+
|
|
48
|
+
fieldType: "Int32",
|
|
49
|
+
|
|
50
|
+
defaultValue: -1,
|
|
51
|
+
documentation: "The symbolicId shall be used to identify a vendor-specific error or condition"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "locale",
|
|
55
|
+
|
|
56
|
+
fieldType: "Int32",
|
|
57
|
+
|
|
58
|
+
defaultValue: -1,
|
|
59
|
+
documentation: "The locale part of the vendor-specific localized text describing the symbolic id."
|
|
60
|
+
},
|
|
61
|
+
{ name: "localizedText", fieldType: "Int32", defaultValue: -1 },
|
|
62
|
+
{
|
|
63
|
+
name: "additionalInfo",
|
|
64
|
+
|
|
65
|
+
fieldType: "String",
|
|
66
|
+
|
|
67
|
+
defaultValue: null,
|
|
68
|
+
documentation: "Vendor-specific diagnostic information."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "innerStatusCode",
|
|
72
|
+
|
|
73
|
+
fieldType: "StatusCode",
|
|
74
|
+
|
|
75
|
+
defaultValue: StatusCodes.Good,
|
|
76
|
+
documentation: "The StatusCode from the inner operation."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "innerDiagnosticInfo",
|
|
80
|
+
|
|
81
|
+
fieldType: "DiagnosticInfo",
|
|
82
|
+
|
|
83
|
+
defaultValue: null,
|
|
84
|
+
documentation: "The diagnostic info associated with the inner StatusCode."
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export class DiagnosticInfo extends BaseUAObject {
|
|
90
|
+
public static schema = schemaDiagnosticInfo;
|
|
91
|
+
public static possibleFields = [
|
|
92
|
+
"symbolicId",
|
|
93
|
+
"namespaceURI",
|
|
94
|
+
"locale",
|
|
95
|
+
"localizedText",
|
|
96
|
+
"additionalInfo",
|
|
97
|
+
"innerStatusCode",
|
|
98
|
+
"innerDiagnosticInfo"
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
public symbolicId: Int32;
|
|
102
|
+
public namespaceURI: Int32;
|
|
103
|
+
public locale: Int32;
|
|
104
|
+
public localizedText: Int32;
|
|
105
|
+
public additionalInfo: UAString;
|
|
106
|
+
public innerStatusCode: StatusCode;
|
|
107
|
+
public innerDiagnosticInfo: DiagnosticInfo;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @class DiagnosticInfo
|
|
112
|
+
* @constructor
|
|
113
|
+
* @extends BaseUAObject
|
|
114
|
+
* @param options {Object}
|
|
115
|
+
*/
|
|
116
|
+
constructor(options: DiagnosticInfoOptions = {}) {
|
|
117
|
+
super();
|
|
118
|
+
const schema = schemaDiagnosticInfo;
|
|
119
|
+
/* istanbul ignore next */
|
|
120
|
+
if (parameters.debugSchemaHelper) {
|
|
121
|
+
check_options_correctness_against_schema(this, schema, options);
|
|
122
|
+
}
|
|
123
|
+
this.symbolicId = initialize_field(schema.fields[0], options.symbolicId) as Int32;
|
|
124
|
+
this.namespaceURI = initialize_field(schema.fields[1], options.namespaceURI) as Int32;
|
|
125
|
+
this.locale = initialize_field(schema.fields[2], options.locale) as Int32;
|
|
126
|
+
this.localizedText = initialize_field(schema.fields[3], options.localizedText) as Int32;
|
|
127
|
+
this.additionalInfo = initialize_field(schema.fields[4], options.additionalInfo) as UAString;
|
|
128
|
+
this.innerStatusCode = initialize_field(schema.fields[5], options.innerStatusCode) as StatusCode;
|
|
129
|
+
this.innerDiagnosticInfo = initialize_field(schema.fields[6], options.innerDiagnosticInfo) as DiagnosticInfo;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public encode(stream: OutputBinaryStream): void {
|
|
133
|
+
encode_DiagnosticInfo(this, stream);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public decode(stream: BinaryStream): void {
|
|
137
|
+
decode_DiagnosticInfo(this, stream);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
public decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void {
|
|
141
|
+
decodeDebug_DiagnosticInfo(this, stream, options);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
DiagnosticInfo.prototype.schema = DiagnosticInfo.schema;
|
|
146
|
+
DiagnosticInfo.schema.fields[6].schema = DiagnosticInfo.schema;
|
|
147
|
+
|
|
148
|
+
export interface DiagnosticInfoOptions {
|
|
149
|
+
symbolicId?: Int32;
|
|
150
|
+
namespaceURI?: Int32;
|
|
151
|
+
locale?: Int32;
|
|
152
|
+
localizedText?: Int32;
|
|
153
|
+
additionalInfo?: UAString;
|
|
154
|
+
innerStatusCode?: StatusCode;
|
|
155
|
+
innerDiagnosticInfo?: DiagnosticInfo;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export enum DiagnosticInfo_EncodingByte {
|
|
159
|
+
SymbolicId = 0x01,
|
|
160
|
+
NamespaceURI = 0x02,
|
|
161
|
+
LocalizedText = 0x04,
|
|
162
|
+
Locale = 0x08,
|
|
163
|
+
AdditionalInfo = 0x10,
|
|
164
|
+
InnerStatusCode = 0x20,
|
|
165
|
+
InnerDiagnosticInfo = 0x40
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// tslint:disable:no-bitwise
|
|
169
|
+
function getDiagnosticInfoEncodingByte(diagnosticInfo: DiagnosticInfo): DiagnosticInfo_EncodingByte {
|
|
170
|
+
assert(diagnosticInfo);
|
|
171
|
+
|
|
172
|
+
let encodingMask = 0;
|
|
173
|
+
|
|
174
|
+
if (diagnosticInfo.symbolicId >= 0) {
|
|
175
|
+
encodingMask |= DiagnosticInfo_EncodingByte.SymbolicId;
|
|
176
|
+
}
|
|
177
|
+
if (diagnosticInfo.namespaceURI >= 0) {
|
|
178
|
+
encodingMask |= DiagnosticInfo_EncodingByte.NamespaceURI;
|
|
179
|
+
}
|
|
180
|
+
if (diagnosticInfo.localizedText >= 0) {
|
|
181
|
+
encodingMask |= DiagnosticInfo_EncodingByte.LocalizedText;
|
|
182
|
+
}
|
|
183
|
+
if (diagnosticInfo.locale >= 0) {
|
|
184
|
+
encodingMask |= DiagnosticInfo_EncodingByte.Locale;
|
|
185
|
+
}
|
|
186
|
+
if (diagnosticInfo.additionalInfo) {
|
|
187
|
+
encodingMask |= DiagnosticInfo_EncodingByte.AdditionalInfo;
|
|
188
|
+
}
|
|
189
|
+
if (diagnosticInfo.innerStatusCode && diagnosticInfo.innerStatusCode !== StatusCodes.Good) {
|
|
190
|
+
encodingMask |= DiagnosticInfo_EncodingByte.InnerStatusCode;
|
|
191
|
+
}
|
|
192
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
193
|
+
encodingMask |= DiagnosticInfo_EncodingByte.InnerDiagnosticInfo;
|
|
194
|
+
}
|
|
195
|
+
return encodingMask;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function encode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: OutputBinaryStream): void {
|
|
199
|
+
const encodingMask = getDiagnosticInfoEncodingByte(diagnosticInfo);
|
|
200
|
+
|
|
201
|
+
// write encoding byte
|
|
202
|
+
encodeByte(encodingMask, stream);
|
|
203
|
+
|
|
204
|
+
// write symbolic id
|
|
205
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
206
|
+
encodeInt32(diagnosticInfo.symbolicId, stream);
|
|
207
|
+
}
|
|
208
|
+
// write namespace uri
|
|
209
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
210
|
+
encodeInt32(diagnosticInfo.namespaceURI, stream);
|
|
211
|
+
}
|
|
212
|
+
// write locale
|
|
213
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
214
|
+
encodeInt32(diagnosticInfo.locale, stream);
|
|
215
|
+
}
|
|
216
|
+
// write localized text
|
|
217
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
218
|
+
encodeInt32(diagnosticInfo.localizedText, stream);
|
|
219
|
+
}
|
|
220
|
+
// write additional info
|
|
221
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
222
|
+
encodeString(diagnosticInfo.additionalInfo, stream);
|
|
223
|
+
}
|
|
224
|
+
// write inner status code
|
|
225
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
226
|
+
encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
|
|
227
|
+
}
|
|
228
|
+
// write innerDiagnosticInfo
|
|
229
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
230
|
+
assert(diagnosticInfo.innerDiagnosticInfo !== null, "missing innerDiagnosticInfo");
|
|
231
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
232
|
+
encode_DiagnosticInfo(diagnosticInfo.innerDiagnosticInfo, stream);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function decodeDebug_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: BinaryStream, options: DecodeDebugOptions): void {
|
|
238
|
+
const tracer = options.tracer;
|
|
239
|
+
|
|
240
|
+
tracer.trace("start", options.name + "(" + "DiagnosticInfo" + ")", stream.length, stream.length);
|
|
241
|
+
|
|
242
|
+
let cursorBefore = stream.length;
|
|
243
|
+
const encodingMask = decodeByte(stream);
|
|
244
|
+
|
|
245
|
+
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
|
|
246
|
+
tracer.encoding_byte(encodingMask, DiagnosticInfo_EncodingByte, cursorBefore, stream.length);
|
|
247
|
+
|
|
248
|
+
cursorBefore = stream.length;
|
|
249
|
+
|
|
250
|
+
// read symbolic id
|
|
251
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
252
|
+
diagnosticInfo.symbolicId = decodeInt32(stream);
|
|
253
|
+
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursorBefore, stream.length, "Int32");
|
|
254
|
+
cursorBefore = stream.length;
|
|
255
|
+
}
|
|
256
|
+
// read namespace uri
|
|
257
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
258
|
+
diagnosticInfo.namespaceURI = decodeInt32(stream);
|
|
259
|
+
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceURI, cursorBefore, stream.length, "Int32");
|
|
260
|
+
cursorBefore = stream.length;
|
|
261
|
+
}
|
|
262
|
+
// read locale
|
|
263
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
264
|
+
diagnosticInfo.locale = decodeInt32(stream);
|
|
265
|
+
tracer.trace("member", "locale", diagnosticInfo.locale, cursorBefore, stream.length, "Int32");
|
|
266
|
+
cursorBefore = stream.length;
|
|
267
|
+
}
|
|
268
|
+
// read localized text
|
|
269
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
270
|
+
diagnosticInfo.localizedText = decodeInt32(stream);
|
|
271
|
+
tracer.trace("member", "localizedText", diagnosticInfo.localizedText, cursorBefore, stream.length, "Int32");
|
|
272
|
+
cursorBefore = stream.length;
|
|
273
|
+
}
|
|
274
|
+
// read additional info
|
|
275
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
276
|
+
diagnosticInfo.additionalInfo = decodeString(stream);
|
|
277
|
+
tracer.trace("member", "additionalInfo", diagnosticInfo.additionalInfo, cursorBefore, stream.length, "String");
|
|
278
|
+
cursorBefore = stream.length;
|
|
279
|
+
}
|
|
280
|
+
// read inner status code
|
|
281
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
282
|
+
diagnosticInfo.innerStatusCode = decodeStatusCode(stream);
|
|
283
|
+
tracer.trace("member", "innerStatusCode", diagnosticInfo.innerStatusCode, cursorBefore, stream.length, "StatusCode");
|
|
284
|
+
cursorBefore = stream.length;
|
|
285
|
+
}
|
|
286
|
+
// read inner status code
|
|
287
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
288
|
+
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
|
|
289
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
290
|
+
diagnosticInfo.innerDiagnosticInfo.decodeDebug(stream, options);
|
|
291
|
+
}
|
|
292
|
+
tracer.trace(
|
|
293
|
+
"member",
|
|
294
|
+
"innerDiagnosticInfo",
|
|
295
|
+
diagnosticInfo.innerDiagnosticInfo,
|
|
296
|
+
cursorBefore,
|
|
297
|
+
stream.length,
|
|
298
|
+
"DiagnosticInfo"
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
tracer.trace("end", options.name, stream.length, stream.length);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function decode_DiagnosticInfo(diagnosticInfo: DiagnosticInfo, stream: BinaryStream): void {
|
|
306
|
+
const encodingMask = decodeByte(stream);
|
|
307
|
+
|
|
308
|
+
// read symbolic id
|
|
309
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
310
|
+
diagnosticInfo.symbolicId = decodeInt32(stream);
|
|
311
|
+
}
|
|
312
|
+
// read namespace uri
|
|
313
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
314
|
+
diagnosticInfo.namespaceURI = decodeInt32(stream);
|
|
315
|
+
}
|
|
316
|
+
// read locale
|
|
317
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
318
|
+
diagnosticInfo.locale = decodeInt32(stream);
|
|
319
|
+
}
|
|
320
|
+
// read localized text
|
|
321
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
322
|
+
diagnosticInfo.localizedText = decodeInt32(stream);
|
|
323
|
+
}
|
|
324
|
+
// read additional info
|
|
325
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
326
|
+
diagnosticInfo.additionalInfo = decodeString(stream);
|
|
327
|
+
}
|
|
328
|
+
// read inner status code
|
|
329
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
330
|
+
diagnosticInfo.innerStatusCode = decodeStatusCode(stream);
|
|
331
|
+
}
|
|
332
|
+
// read inner status code
|
|
333
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
334
|
+
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
|
|
335
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
336
|
+
diagnosticInfo.innerDiagnosticInfo.decode(stream);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const emptyDiagnosticInfo = new DiagnosticInfo({});
|
|
342
|
+
|
|
343
|
+
export function encodeDiagnosticInfo(value: DiagnosticInfo | null, stream: OutputBinaryStream): void {
|
|
344
|
+
if (value === null) {
|
|
345
|
+
emptyDiagnosticInfo.encode(stream);
|
|
346
|
+
} else {
|
|
347
|
+
value.encode(stream);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export function decodeDiagnosticInfo(stream: BinaryStream, _value?: DiagnosticInfo | null): DiagnosticInfo {
|
|
352
|
+
const value = _value || new DiagnosticInfo();
|
|
353
|
+
value.decode(stream);
|
|
354
|
+
return value;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Note:
|
|
358
|
+
// the SymbolicId, NamespaceURI, LocalizedText and Locale fields are indexes in a string table which is returned
|
|
359
|
+
// in the response header. Only the index of the corresponding string in the string table is encoded. An index
|
|
360
|
+
// of −1 indicates that there is no value for the string.
|
|
361
|
+
//
|
|
362
|
+
registerSpecialVariantEncoder(DiagnosticInfo);
|