blob: 7df2fce33ba971b51129ce73359ca3c3038cfdee [file] [log] [blame]
Scott Bakere7144bc2019-10-01 14:16:47 -07001package jsoniter
2
3import (
4 "strconv"
5)
6
7type uint64Any struct {
8 baseAny
9 val uint64
10}
11
12func (any *uint64Any) LastError() error {
13 return nil
14}
15
16func (any *uint64Any) ValueType() ValueType {
17 return NumberValue
18}
19
20func (any *uint64Any) MustBeValid() Any {
21 return any
22}
23
24func (any *uint64Any) ToBool() bool {
25 return any.val != 0
26}
27
28func (any *uint64Any) ToInt() int {
29 return int(any.val)
30}
31
32func (any *uint64Any) ToInt32() int32 {
33 return int32(any.val)
34}
35
36func (any *uint64Any) ToInt64() int64 {
37 return int64(any.val)
38}
39
40func (any *uint64Any) ToUint() uint {
41 return uint(any.val)
42}
43
44func (any *uint64Any) ToUint32() uint32 {
45 return uint32(any.val)
46}
47
48func (any *uint64Any) ToUint64() uint64 {
49 return any.val
50}
51
52func (any *uint64Any) ToFloat32() float32 {
53 return float32(any.val)
54}
55
56func (any *uint64Any) ToFloat64() float64 {
57 return float64(any.val)
58}
59
60func (any *uint64Any) ToString() string {
61 return strconv.FormatUint(any.val, 10)
62}
63
64func (any *uint64Any) WriteTo(stream *Stream) {
65 stream.WriteUint64(any.val)
66}
67
68func (any *uint64Any) Parse() *Iterator {
69 return nil
70}
71
72func (any *uint64Any) GetInterface() interface{} {
73 return any.val
74}