Example #1
0
 private void ReadNull(ref JReader r, ValueVariant variant)
 {
     if (variant == NullableBoolIsNull)
     {
         RequireNull(r.BoolOrNull());
     }
     else if (variant == NullableIntIsNull)
     {
         RequireNull(r.IntOrNull());
     }
     else if (variant == NullableLongIsNull)
     {
         RequireNull(r.LongOrNull());
     }
     else if (variant == NullableDoubleIsNull)
     {
         RequireNull(r.DoubleOrNull());
     }
     else if (variant == NullableStringIsNull)
     {
         Assert.True(r.StringOrNull() == null, "expected null");
     }
     else if (variant == NullableArrayIsNull)
     {
         Assert.False(r.ArrayOrNull().IsDefined, "expected null");
     }
     else if (variant == NullableObjectIsNull)
     {
         Assert.False(r.ObjectOrNull().IsDefined, "expected null");
     }
     else
     {
         r.Null();
     }
 }