Statistics
| Branch: | Tag: | Revision:

root / Assets / Plugins / LitJson / IJsonWrapper.cs @ 11:01dde4258840

History | View | Annotate | Download (1.4 kB)

1
#region Header
2
/**
3
 * IJsonWrapper.cs
4
 *   Interface that represents a type capable of handling all kinds of JSON
5
 *   data. This is mainly used when mapping objects through JsonMapper, and
6
 *   it's implemented by JsonData.
7
 *
8
 * The authors disclaim copyright to this source code. For more details, see
9
 * the COPYING file included with this distribution.
10
 **/
11
#endregion
12
13
14
using System.Collections;
15
using System.Collections.Specialized;
16
17
18
namespace LitJson
19
{
20
    public enum JsonType
21
    {
22
        None,
23
24
        Object,
25
        Array,
26
        String,
27
        Int,
28
        Long,
29
        Double,
30
        Boolean
31
    }
32
33
    public interface IJsonWrapper : IList, IOrderedDictionary
34
    {
35
        bool IsArray   { get; }
36
        bool IsBoolean { get; }
37
        bool IsDouble  { get; }
38
        bool IsInt     { get; }
39
        bool IsLong    { get; }
40
        bool IsObject  { get; }
41
        bool IsString  { get; }
42
43
        bool     GetBoolean ();
44
        double   GetDouble ();
45
        int      GetInt ();
46
        JsonType GetJsonType ();
47
        long     GetLong ();
48
        string   GetString ();
49
50
        void SetBoolean  (bool val);
51
        void SetDouble   (double val);
52
        void SetInt      (int val);
53
        void SetJsonType (JsonType type);
54
        void SetLong     (long val);
55
        void SetString   (string val);
56
57
        string ToJson ();
58
        void   ToJson (JsonWriter writer);
59
    }
60
}