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); } AppendValue(c); _currentContainer = c; }
internal override void DoAdd(IonContainer container, IonValue item) { var fieldName = $"Field{_serial++}"; var v = (IonStruct)container; v[fieldName] = item; }
public override void StepOut() { if (_currentContainer.Container is null) { throw new InvalidOperationException("Cannot step out of top level value"); } _currentContainer = _currentContainer.Container; }
/// <summary> /// Implementations should add <paramref name="item"/> to <paramref name="container"/>. /// </summary> protected abstract void DoAdd(IonContainer container, IonValue item);
public IonTreeWriter(IonContainer root) { Debug.Assert(root != null); _currentContainer = root; _containers.Push(root); }
protected override void DoAdd(IonContainer container, IonValue item) { var list = (IonList)container; list.Add(item); }
public IonTreeWriter(IonContainer root) { Debug.Assert(root != null, "root is null"); this.currentContainer = root; this.containers.Push(root); }
protected override void DoAdd(IonContainer container, IonValue item) { container.Add(item); }
public IonTreeWriter(IonContainer root) : base(IonWriterBuilderBase.InitialIvmHandlingOption.Suppress) { Debug.Assert(root != null); _currentContainer = root; }
internal override void DoAdd(IonContainer container, IonValue item) { container.Add(item); }
/// <summary> /// Implementations should add <paramref name="item"/> to <paramref name="container"/>. /// </summary> internal abstract void DoAdd(IonContainer container, IonValue item);