Esempio n. 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;
        }
Esempio n. 2
0
 public override void StepOut()
 {
     if (_containers.Count > 0)
     {
         _containers.Pop();
         _currentContainer = _containers.Peek();
     }
     else
     {
         throw new InvalidOperationException("Cannot step out of top level value");
     }
 }
Esempio n. 3
0
 public IIonWriter NewWriter(IIonContainer container)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public IonTreeWriter(IonContainer root)
 {
     Debug.Assert(root != null);
     _currentContainer = root;
     _containers.Push(root);
 }
Esempio n. 5
0
 public IonTreeWriter(IonContainer root)
 {
     Debug.Assert(root != null, "root is null");
     this.currentContainer = root;
     this.containers.Push(root);
 }