130 references to CborMajorType
System.Formats.Cbor (130)
System\Formats\Cbor\CborInitialByte.cs (3)
45
public CborInitialByte(
CborMajorType
majorType, CborAdditionalInfo additionalInfo)
58
public
CborMajorType
MajorType => (
CborMajorType
)(InitialByte >> 5);
System\Formats\Cbor\Reader\CborReader.Array.cs (5)
18
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Array);
29
PushDataItem(
CborMajorType
.Array, null);
38
PushDataItem(
CborMajorType
.Array, arrayLength);
55
PopDataItem(expectedType:
CborMajorType
.Array);
61
PopDataItem(expectedType:
CborMajorType
.Array);
System\Formats\Cbor\Reader\CborReader.cs (10)
18
private
CborMajorType
? _currentMajorType; // major type of the currently written data item. Null iff at the root context
166
case
CborMajorType
.ByteString:
167
case
CborMajorType
.TextString:
184
private CborInitialByte PeekInitialByte(
CborMajorType
expectedType)
214
private void PushDataItem(
CborMajorType
majorType, int? definiteLength)
242
private void PopDataItem(
CborMajorType
expectedType)
266
if (_currentMajorType ==
CborMajorType
.Map)
279
if (_currentMajorType ==
CborMajorType
.Map)
334
CborMajorType
? type,
352
public
CborMajorType
? MajorType { get; }
System\Formats\Cbor\Reader\CborReader.Integer.cs (5)
97
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.NegativeInteger);
110
case
CborMajorType
.UnsignedInteger:
114
case
CborMajorType
.NegativeInteger:
129
case
CborMajorType
.UnsignedInteger:
133
case
CborMajorType
.NegativeInteger:
System\Formats\Cbor\Reader\CborReader.Map.cs (5)
33
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Map);
44
PushDataItem(
CborMajorType
.Map, null);
59
PushDataItem(
CborMajorType
.Map, 2 * mapSize);
87
PopDataItem(expectedType:
CborMajorType
.Map);
93
PopDataItem(expectedType:
CborMajorType
.Map);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (17)
35
case
CborMajorType
.Array: return CborReaderState.EndArray;
36
case
CborMajorType
.Map: return CborReaderState.EndMap;
77
case
CborMajorType
.ByteString: return CborReaderState.EndIndefiniteLengthByteString;
78
case
CborMajorType
.TextString: return CborReaderState.EndIndefiniteLengthTextString;
79
case
CborMajorType
.Array: return CborReaderState.EndArray;
80
case
CborMajorType
.Map when _itemsRead % 2 == 0: return CborReaderState.EndMap;
81
case
CborMajorType
.Map:
99
case
CborMajorType
.ByteString:
100
case
CborMajorType
.TextString:
112
case
CborMajorType
.UnsignedInteger: return CborReaderState.UnsignedInteger;
113
case
CborMajorType
.NegativeInteger: return CborReaderState.NegativeInteger;
114
case
CborMajorType
.ByteString:
119
case
CborMajorType
.TextString:
124
case
CborMajorType
.Array: return CborReaderState.StartArray;
125
case
CborMajorType
.Map: return CborReaderState.StartMap;
126
case
CborMajorType
.Tag: return CborReaderState.Tag;
127
case
CborMajorType
.Simple: return MapSimpleValueDataToReaderState(initialByte.AdditionalInfo);
System\Formats\Cbor\Reader\CborReader.Simple.cs (5)
24
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
65
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
109
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
134
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
159
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
System\Formats\Cbor\Reader\CborReader.Simple.netcoreapp.cs (1)
24
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Simple);
System\Formats\Cbor\Reader\CborReader.SkipValue.cs (2)
86
SkipString(type:
CborMajorType
.ByteString);
90
SkipString(type:
CborMajorType
.TextString);
System\Formats\Cbor\Reader\CborReader.String.cs (22)
29
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.ByteString);
64
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.ByteString);
106
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.ByteString);
134
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.ByteString);
148
PushDataItem(
CborMajorType
.ByteString, definiteLength: null);
159
PopDataItem(
CborMajorType
.ByteString);
175
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
221
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
267
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
302
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
316
PushDataItem(
CborMajorType
.TextString, definiteLength: null);
327
PopDataItem(
CborMajorType
.TextString);
334
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.ByteString, out int encodingLength, out int concatenatedBufferSize);
355
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.ByteString, out int encodingLength, out int concatenatedBufferSize);
380
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.TextString, out int encodingLength, out int concatenatedBufferSize);
415
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.TextString, out int encodingLength, out int _);
448
private List<(int Offset, int Length)> ReadIndefiniteLengthStringChunkRanges(
CborMajorType
type, out int encodingLength, out int concatenatedBufferSize)
472
static CborInitialByte ReadNextInitialByte(ReadOnlySpan<byte> buffer,
CborMajorType
expectedType)
487
private void SkipString(
CborMajorType
type)
489
Debug.Assert(type ==
CborMajorType
.ByteString || type ==
CborMajorType
.TextString);
498
if (type ==
CborMajorType
.TextString && _isConformanceModeCheckEnabled &&
System\Formats\Cbor\Reader\CborReader.Tag.cs (1)
284
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.Tag);
System\Formats\Cbor\Writer\CborWriter.Array.cs (8)
42
PopDataItem(
CborMajorType
.Array);
54
WriteUnsignedInteger(
CborMajorType
.Array, (ulong)definiteLength);
55
PushDataItem(
CborMajorType
.Array, definiteLength);
67
WriteInitialByte(new CborInitialByte(
CborMajorType
.Array, CborAdditionalInfo.IndefiniteLength));
68
PushDataItem(
CborMajorType
.Array, definiteLength: null);
72
private void PatchIndefiniteLengthCollection(
CborMajorType
majorType, int count)
74
Debug.Assert(majorType ==
CborMajorType
.Array || majorType ==
CborMajorType
.Map);
System\Formats\Cbor\Writer\CborWriter.cs (17)
23
private
CborMajorType
? _currentMajorType; // major type of the current data item context
308
private void PushDataItem(
CborMajorType
newMajorType, int? definiteLength)
340
private void PopDataItem(
CborMajorType
typeToPop)
360
throw new InvalidOperationException(SR.Format(SR.Cbor_PopMajorTypeMismatch, (int)
CborMajorType
.Tag));
371
if (typeToPop ==
CborMajorType
.Map)
397
if (_currentMajorType ==
CborMajorType
.Map)
422
case
CborMajorType
.ByteString:
423
case
CborMajorType
.TextString:
440
private void CompleteIndefiniteLengthWrite(
CborMajorType
type)
449
case
CborMajorType
.ByteString:
450
case
CborMajorType
.TextString:
453
case
CborMajorType
.Array:
454
PatchIndefiniteLengthCollection(
CborMajorType
.Array, _itemsWritten);
456
case
CborMajorType
.Map:
458
PatchIndefiniteLengthCollection(
CborMajorType
.Map, _itemsWritten / 2);
476
CborMajorType
? type,
497
public
CborMajorType
? MajorType { get; }
System\Formats\Cbor\Writer\CborWriter.Integer.cs (5)
33
WriteUnsignedInteger(
CborMajorType
.NegativeInteger, unsignedRepresentation);
37
WriteUnsignedInteger(
CborMajorType
.UnsignedInteger, (ulong)value);
63
WriteUnsignedInteger(
CborMajorType
.UnsignedInteger, value);
81
WriteUnsignedInteger(
CborMajorType
.NegativeInteger, value);
85
private void WriteUnsignedInteger(
CborMajorType
type, ulong value)
System\Formats\Cbor\Writer\CborWriter.Map.cs (5)
60
PopDataItem(
CborMajorType
.Map);
72
WriteUnsignedInteger(
CborMajorType
.Map, (ulong)definiteLength);
73
PushDataItem(
CborMajorType
.Map, definiteLength: 2 * definiteLength);
86
WriteInitialByte(new CborInitialByte(
CborMajorType
.Map, CborAdditionalInfo.IndefiniteLength));
87
PushDataItem(
CborMajorType
.Map, definiteLength: null);
System\Formats\Cbor\Writer\CborWriter.Simple.cs (4)
65
WriteInitialByte(new CborInitialByte(
CborMajorType
.Simple, CborAdditionalInfo.Additional32BitData));
74
WriteInitialByte(new CborInitialByte(
CborMajorType
.Simple, CborAdditionalInfo.Additional64BitData));
116
WriteInitialByte(new CborInitialByte(
CborMajorType
.Simple, (CborAdditionalInfo)value));
126
WriteInitialByte(new CborInitialByte(
CborMajorType
.Simple, CborAdditionalInfo.Additional8BitData));
System\Formats\Cbor\Writer\CborWriter.Simple.netcoreapp.cs (1)
23
WriteInitialByte(new CborInitialByte(
CborMajorType
.Simple, CborAdditionalInfo.Additional16BitData));
System\Formats\Cbor\Writer\CborWriter.String.cs (13)
41
WriteUnsignedInteger(
CborMajorType
.ByteString, (ulong)value.Length);
44
if (ConvertIndefiniteLengthEncodings && _currentMajorType ==
CborMajorType
.ByteString)
87
WriteInitialByte(new CborInitialByte(
CborMajorType
.ByteString, CborAdditionalInfo.IndefiniteLength));
88
PushDataItem(
CborMajorType
.ByteString, definiteLength: null);
95
PopDataItem(
CborMajorType
.ByteString);
137
WriteUnsignedInteger(
CborMajorType
.TextString, (ulong)length);
140
if (ConvertIndefiniteLengthEncodings && _currentMajorType ==
CborMajorType
.TextString)
183
WriteInitialByte(new CborInitialByte(
CborMajorType
.TextString, CborAdditionalInfo.IndefiniteLength));
184
PushDataItem(
CborMajorType
.TextString, definiteLength: null);
191
PopDataItem(
CborMajorType
.TextString);
196
private void PatchIndefiniteLengthString(
CborMajorType
type)
198
Debug.Assert(type ==
CborMajorType
.ByteString || type ==
CborMajorType
.TextString);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
27
WriteUnsignedInteger(
CborMajorType
.Tag, (ulong)tag);