public void Append(IWritableMValue writable) { // Only valid when we have a open Name without a value if (Names.Count > Values.Count) { Values.Add(writable.ToMValue()); } }
public void Append(IWritableMValue writable) { // Only valid when we have a open Name without a value if (Names.Count > Values.Count) { writable.ToMValue(out var mValue); Values.Add(mValue); } else { throw new ArithmeticException("Name(name) is required before writing a object."); } }
public void EndObject() { if (currents.TryPop(out currCurr)) { if (currents.TryPeek(out curr)) { curr.Append(currCurr); } else { // We are first current root = currCurr; } } }
public void EndArray() { if (currents.TryPop(out currCurr)) { if (currCurr.Type != 1) { throw new ArithmeticException("Expected EndObject, got EndArray"); } if (currents.TryPeek(out curr)) { curr.Append(currCurr); } else { // We are first current root = currCurr; } } else { throw new ArithmeticException("Invalid EndArray without BeginArray"); } }
public void Append(IWritableMValue writable) { writable.ToMValue(out var mValue); Values.Add(mValue); }
public void Append(IWritableMValue writable) { Values.Add(writable.ToMValue()); }