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);
28
PushDataItem(
CborMajorType
.Array, null);
37
PushDataItem(
CborMajorType
.Array, arrayLength);
54
PopDataItem(expectedType:
CborMajorType
.Array);
60
PopDataItem(expectedType:
CborMajorType
.Array);
System\Formats\Cbor\Reader\CborReader.cs (10)
16
private
CborMajorType
? _currentMajorType; // major type of the currently written data item. Null iff at the root context
134
case
CborMajorType
.ByteString:
135
case
CborMajorType
.TextString:
152
private CborInitialByte PeekInitialByte(
CborMajorType
expectedType)
174
private void PushDataItem(
CborMajorType
majorType, int? definiteLength)
200
private void PopDataItem(
CborMajorType
expectedType)
224
if (_currentMajorType ==
CborMajorType
.Map)
237
if (_currentMajorType ==
CborMajorType
.Map)
292
CborMajorType
? type,
310
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);
43
PushDataItem(
CborMajorType
.Map, null);
58
PushDataItem(
CborMajorType
.Map, 2 * mapSize);
86
PopDataItem(expectedType:
CborMajorType
.Map);
92
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);
147
PushDataItem(
CborMajorType
.ByteString, definiteLength: null);
158
PopDataItem(
CborMajorType
.ByteString);
174
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
220
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
266
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
301
CborInitialByte header = PeekInitialByte(expectedType:
CborMajorType
.TextString);
314
PushDataItem(
CborMajorType
.TextString, definiteLength: null);
325
PopDataItem(
CborMajorType
.TextString);
332
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.ByteString, out int encodingLength, out int concatenatedBufferSize);
353
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.ByteString, out int encodingLength, out int concatenatedBufferSize);
378
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.TextString, out int encodingLength, out int concatenatedBufferSize);
413
List<(int Offset, int Length)> ranges = ReadIndefiniteLengthStringChunkRanges(
CborMajorType
.TextString, out int encodingLength, out int _);
446
private List<(int Offset, int Length)> ReadIndefiniteLengthStringChunkRanges(
CborMajorType
type, out int encodingLength, out int concatenatedBufferSize)
468
static CborInitialByte ReadNextInitialByte(ReadOnlySpan<byte> buffer,
CborMajorType
expectedType)
483
private void SkipString(
CborMajorType
type)
485
Debug.Assert(type ==
CborMajorType
.ByteString || type ==
CborMajorType
.TextString);
494
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);
53
WriteUnsignedInteger(
CborMajorType
.Array, (ulong)definiteLength);
54
PushDataItem(
CborMajorType
.Array, definiteLength);
65
WriteInitialByte(new CborInitialByte(
CborMajorType
.Array, CborAdditionalInfo.IndefiniteLength));
66
PushDataItem(
CborMajorType
.Array, definiteLength: null);
70
private void PatchIndefiniteLengthCollection(
CborMajorType
majorType, int count)
72
Debug.Assert(majorType ==
CborMajorType
.Array || majorType ==
CborMajorType
.Map);
System\Formats\Cbor\Writer\CborWriter.cs (17)
22
private
CborMajorType
? _currentMajorType; // major type of the current data item context
258
private void PushDataItem(
CborMajorType
newMajorType, int? definiteLength)
288
private void PopDataItem(
CborMajorType
typeToPop)
308
throw new InvalidOperationException(SR.Format(SR.Cbor_PopMajorTypeMismatch, (int)
CborMajorType
.Tag));
319
if (typeToPop ==
CborMajorType
.Map)
345
if (_currentMajorType ==
CborMajorType
.Map)
370
case
CborMajorType
.ByteString:
371
case
CborMajorType
.TextString:
388
private void CompleteIndefiniteLengthWrite(
CborMajorType
type)
397
case
CborMajorType
.ByteString:
398
case
CborMajorType
.TextString:
401
case
CborMajorType
.Array:
402
PatchIndefiniteLengthCollection(
CborMajorType
.Array, _itemsWritten);
404
case
CborMajorType
.Map:
406
PatchIndefiniteLengthCollection(
CborMajorType
.Map, _itemsWritten / 2);
424
CborMajorType
? type,
445
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);
71
WriteUnsignedInteger(
CborMajorType
.Map, (ulong)definiteLength);
72
PushDataItem(
CborMajorType
.Map, definiteLength: 2 * definiteLength);
84
WriteInitialByte(new CborInitialByte(
CborMajorType
.Map, CborAdditionalInfo.IndefiniteLength));
85
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)
44
WriteUnsignedInteger(
CborMajorType
.ByteString, (ulong)value.Length);
47
if (ConvertIndefiniteLengthEncodings && _currentMajorType ==
CborMajorType
.ByteString)
88
WriteInitialByte(new CborInitialByte(
CborMajorType
.ByteString, CborAdditionalInfo.IndefiniteLength));
89
PushDataItem(
CborMajorType
.ByteString, definiteLength: null);
96
PopDataItem(
CborMajorType
.ByteString);
141
WriteUnsignedInteger(
CborMajorType
.TextString, (ulong)length);
144
if (ConvertIndefiniteLengthEncodings && _currentMajorType ==
CborMajorType
.TextString)
185
WriteInitialByte(new CborInitialByte(
CborMajorType
.TextString, CborAdditionalInfo.IndefiniteLength));
186
PushDataItem(
CborMajorType
.TextString, definiteLength: null);
193
PopDataItem(
CborMajorType
.TextString);
198
private void PatchIndefiniteLengthString(
CborMajorType
type)
200
Debug.Assert(type ==
CborMajorType
.ByteString || type ==
CborMajorType
.TextString);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
27
WriteUnsignedInteger(
CborMajorType
.Tag, (ulong)tag);