MCPcopy Create free account
hub / github.com/apache/fory / SkipValue

Method SkipValue

csharp/src/Fory/FieldSkipper.cs:27–72  ·  view source on GitHub ↗
(
        ReadContext context,
        TypeMetaFieldType fieldType,
        RefMode refMode,
        TypeInfo? resolvedTypeInfo = null)

Source from the content-addressed store, hash-verified

25 }
26
27 private static void SkipValue(
28 ReadContext context,
29 TypeMetaFieldType fieldType,
30 RefMode refMode,
31 TypeInfo? resolvedTypeInfo = null)
32 {
33 if (resolvedTypeInfo is not null)
34 {
35 _ = ReadResolvedValue(context, resolvedTypeInfo, refMode);
36 return;
37 }
38
39 if (HasInlineTypeInfo(fieldType.TypeId))
40 {
41 _ = ReadInlineTypedValue(context, refMode);
42 return;
43 }
44
45 switch (refMode)
46 {
47 case RefMode.None:
48 SkipPayload(context, fieldType);
49 return;
50 case RefMode.NullOnly:
51 {
52 sbyte flag = context.Reader.ReadInt8();
53 if (flag == (sbyte)RefFlag.Null)
54 {
55 return;
56 }
57
58 if (flag != (sbyte)RefFlag.NotNullValue)
59 {
60 throw new InvalidDataException($"unexpected nullOnly flag {flag}");
61 }
62
63 SkipPayload(context, fieldType);
64 return;
65 }
66 case RefMode.Tracking:
67 _ = ReadTrackedValue(context, fieldType);
68 return;
69 default:
70 throw new InvalidDataException($"unsupported ref mode {refMode}");
71 }
72 }
73
74 private static bool HasInlineTypeInfo(uint typeId)
75 {

Callers

nothing calls this directly

Calls 1

ReadInt8Method · 0.45

Tested by

no test coverage detected