Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (3.5 kB)

1
#region Header
2
/**
3
 * JsonMockWrapper.cs
4
 *   Mock object implementing IJsonWrapper, to facilitate actions like
5
 *   skipping data more efficiently.
6
 *
7
 * The authors disclaim copyright to this source code. For more details, see
8
 * the COPYING file included with this distribution.
9
 **/
10
#endregion
11
12
13
using System;
14
using System.Collections;
15
using System.Collections.Specialized;
16
17
18
namespace LitJson
19
{
20
    public class JsonMockWrapper : IJsonWrapper
21
    {
22
        public bool IsArray   { get { return false; } }
23
        public bool IsBoolean { get { return false; } }
24
        public bool IsDouble  { get { return false; } }
25
        public bool IsInt     { get { return false; } }
26
        public bool IsLong    { get { return false; } }
27
        public bool IsObject  { get { return false; } }
28
        public bool IsString  { get { return false; } }
29
30
        public bool     GetBoolean ()  { return false; }
31
        public double   GetDouble ()   { return 0.0; }
32
        public int      GetInt ()      { return 0; }
33
        public JsonType GetJsonType () { return JsonType.None; }
34
        public long     GetLong ()     { return 0L; }
35
        public string   GetString ()   { return ""; }
36
37
        public void SetBoolean  (bool val)      {}
38
        public void SetDouble   (double val)    {}
39
        public void SetInt      (int val)       {}
40
        public void SetJsonType (JsonType type) {}
41
        public void SetLong     (long val)      {}
42
        public void SetString   (string val)    {}
43
44
        public string ToJson ()                  { return ""; }
45
        public void   ToJson (JsonWriter writer) {}
46
47
48
        bool IList.IsFixedSize { get { return true; } }
49
        bool IList.IsReadOnly  { get { return true; } }
50
51
        object IList.this[int index] {
52
            get { return null; }
53
            set {}
54
        }
55
56
        int  IList.Add (object value)       { return 0; }
57
        void IList.Clear ()                 {}
58
        bool IList.Contains (object value)  { return false; }
59
        int  IList.IndexOf (object value)   { return -1; }
60
        void IList.Insert (int i, object v) {}
61
        void IList.Remove (object value)    {}
62
        void IList.RemoveAt (int index)     {}
63
64
65
        int    ICollection.Count          { get { return 0; } }
66
        bool   ICollection.IsSynchronized { get { return false; } }
67
        object ICollection.SyncRoot       { get { return null; } }
68
69
        void ICollection.CopyTo (Array array, int index) {}
70
71
72
        IEnumerator IEnumerable.GetEnumerator () { return null; }
73
74
75
        bool IDictionary.IsFixedSize { get { return true; } }
76
        bool IDictionary.IsReadOnly  { get { return true; } }
77
78
        ICollection IDictionary.Keys   { get { return null; } }
79
        ICollection IDictionary.Values { get { return null; } }
80
81
        object IDictionary.this[object key] {
82
            get { return null; }
83
            set {}
84
        }
85
86
        void IDictionary.Add (object k, object v) {}
87
        void IDictionary.Clear ()                 {}
88
        bool IDictionary.Contains (object key)    { return false; }
89
        void IDictionary.Remove (object key)      {}
90
91
        IDictionaryEnumerator IDictionary.GetEnumerator () { return null; }
92
93
94
        object IOrderedDictionary.this[int idx] {
95
            get { return null; }
96
            set {}
97
        }
98
99
        IDictionaryEnumerator IOrderedDictionary.GetEnumerator () {
100
            return null;
101
        }
102
        void IOrderedDictionary.Insert   (int i, object k, object v) {}
103
        void IOrderedDictionary.RemoveAt (int i) {}
104
    }
105
}