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