Exemplo n.º 1
0
 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());
     }
 }
Exemplo n.º 2
0
 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.");
     }
 }
Exemplo n.º 3
0
 public void EndObject()
 {
     if (currents.TryPop(out currCurr))
     {
         if (currents.TryPeek(out curr))
         {
             curr.Append(currCurr);
         }
         else
         {
             // We are first current
             root = currCurr;
         }
     }
 }
Exemplo n.º 4
0
        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");
            }
        }
Exemplo n.º 5
0
 public void Append(IWritableMValue writable)
 {
     writable.ToMValue(out var mValue);
     Values.Add(mValue);
 }
Exemplo n.º 6
0
 public void Append(IWritableMValue writable)
 {
     Values.Add(writable.ToMValue());
 }