blob: 9452324af5b17483f48e7b453c44266c3078032b [file] [log] [blame]
khenaidooab1f7bd2019-11-14 14:00:27 -05001package jsoniter
2
3type trueAny struct {
4 baseAny
5}
6
7func (any *trueAny) LastError() error {
8 return nil
9}
10
11func (any *trueAny) ToBool() bool {
12 return true
13}
14
15func (any *trueAny) ToInt() int {
16 return 1
17}
18
19func (any *trueAny) ToInt32() int32 {
20 return 1
21}
22
23func (any *trueAny) ToInt64() int64 {
24 return 1
25}
26
27func (any *trueAny) ToUint() uint {
28 return 1
29}
30
31func (any *trueAny) ToUint32() uint32 {
32 return 1
33}
34
35func (any *trueAny) ToUint64() uint64 {
36 return 1
37}
38
39func (any *trueAny) ToFloat32() float32 {
40 return 1
41}
42
43func (any *trueAny) ToFloat64() float64 {
44 return 1
45}
46
47func (any *trueAny) ToString() string {
48 return "true"
49}
50
51func (any *trueAny) WriteTo(stream *Stream) {
52 stream.WriteTrue()
53}
54
55func (any *trueAny) Parse() *Iterator {
56 return nil
57}
58
59func (any *trueAny) GetInterface() interface{} {
60 return true
61}
62
63func (any *trueAny) ValueType() ValueType {
64 return BoolValue
65}
66
67func (any *trueAny) MustBeValid() Any {
68 return any
69}
70
71type falseAny struct {
72 baseAny
73}
74
75func (any *falseAny) LastError() error {
76 return nil
77}
78
79func (any *falseAny) ToBool() bool {
80 return false
81}
82
83func (any *falseAny) ToInt() int {
84 return 0
85}
86
87func (any *falseAny) ToInt32() int32 {
88 return 0
89}
90
91func (any *falseAny) ToInt64() int64 {
92 return 0
93}
94
95func (any *falseAny) ToUint() uint {
96 return 0
97}
98
99func (any *falseAny) ToUint32() uint32 {
100 return 0
101}
102
103func (any *falseAny) ToUint64() uint64 {
104 return 0
105}
106
107func (any *falseAny) ToFloat32() float32 {
108 return 0
109}
110
111func (any *falseAny) ToFloat64() float64 {
112 return 0
113}
114
115func (any *falseAny) ToString() string {
116 return "false"
117}
118
119func (any *falseAny) WriteTo(stream *Stream) {
120 stream.WriteFalse()
121}
122
123func (any *falseAny) Parse() *Iterator {
124 return nil
125}
126
127func (any *falseAny) GetInterface() interface{} {
128 return false
129}
130
131func (any *falseAny) ValueType() ValueType {
132 return BoolValue
133}
134
135func (any *falseAny) MustBeValid() Any {
136 return any
137}