Example #1
0
        public override void StepIn(IonType type)
        {
            IonContainer c;

            switch (type)
            {
            case IonType.List:
                c = new IonList();
                break;

            case IonType.Sexp:
                c = new IonSexp();
                break;

            case IonType.Struct:
                c = new IonStruct();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }

            _containers.Push(c);
            AppendValue(c);
            _currentContainer = c;
        }
Example #2
0
        public override void WriteNull(IonType type)
        {
            IonValue v;

            switch (type)
            {
            case IonType.Null:
                v = new IonNull();
                break;

            case IonType.Bool:
                v = IonBool.NewNull();
                break;

            case IonType.Int:
                v = IonInt.NewNull();
                break;

            case IonType.Float:
                v = IonFloat.NewNull();
                break;

            case IonType.Decimal:
                v = IonDecimal.NewNull();
                break;

            case IonType.Timestamp:
                v = IonTimestamp.NewNull();
                break;

            case IonType.Symbol:
                v = IonSymbol.NewNull();
                break;

            case IonType.String:
                v = new IonString(null);
                break;

            case IonType.Clob:
                v = IonClob.NewNull();
                break;

            case IonType.Blob:
                v = IonBlob.NewNull();
                break;

            case IonType.List:
                v = IonList.NewNull();
                break;

            case IonType.Sexp:
                v = IonSexp.NewNull();
                break;

            case IonType.Struct:
                v = IonStruct.NewNull();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }

            AppendValue(v);
        }
Example #3
0
 protected override IonContainer MakeNullValue()
 {
     return(IonSexp.NewNull());
 }
Example #4
0
 internal override IonContainer MakeNullValue()
 {
     return(IonSexp.NewNull());
 }