Exemplo n.º 1
0
                public override string ToString()
                {
                    switch (Type)
                    {
                    case Token.NumberFloat:
                        return(FloatValue.ToString(CultureInfo.InvariantCulture));

                    case Token.NumberInteger:
                        return(IntegerValue.ToString(CultureInfo.InvariantCulture));

                    case Token.NumberUnsignedInteger:
                        return(UnsignedIntegerValue.ToString(CultureInfo.InvariantCulture));

                    case Token.String:
                        return("\"" + JsonString.Escape(StringValue) + "\"");

                    case Token.Boolean:
                        return(BooleanValue ? "true" : "false");

                    case Token.Colon:
                        return(":");

                    case Token.Comma:
                        return(",");

                    case Token.Null:
                        return("null");

                    case Token.CurlyOpen:
                        return("{");

                    case Token.CurlyClose:
                        return("}");

                    case Token.SquaredOpen:
                        return("[");

                    case Token.SquaredClose:
                        return("]");

                    case Token.None:
                        return("end of stream");

                    default:
                        return(Type.ToString());
                    }
                }
 public void String(string value)
 {
     JsonString.Escape(value, mTemp);
     mWriter.Write(mTemp.ToString());
     mTemp.Clear();
 }