|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Apolyton.FastJson.Data;
namespace Apolyton.FastJson.Data
{
/// <summary>
/// Represents a json object.
/// </summary>
public interface IJsonValue
{
/// <summary>
/// Gets the count of the members.
/// </summary>
/// <exception cref="InvalidOperationException">If item is not enumerable and has no count.</exception>
int Count { get; }
/// <summary>
/// Gets the json value type.
/// </summary>
JsonType Type { get; }
/// <summary>
/// Gets the value at the specified index.
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException">If item is not a json array.</exception>
IJsonValue this[int i] { get; }
/// <summary>
/// Gets the key at the specified index.
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException">If item is not a json object.</exception>s
IJsonValue this[String key] { get; }
/// <summary>
/// Gets the value as string.
/// </summary>
String AsString { get; }
/// <summary>
/// Gets the value as integer.
/// </summary>
Int32 AsInteger { get; }
/// <summary>
/// Gets the value as double.
/// </summary>
Double AsDouble { get; }
/// <summary>
/// Gets the value as guid.
/// </summary>
Guid AsGuid { get; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.