-
Notifications
You must be signed in to change notification settings - Fork 24
/
enumgen.go
132 lines (88 loc) · 5.15 KB
/
enumgen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Code generated by "core generate -add-types"; DO NOT EDIT.
package relpos
import (
"cogentcore.org/core/enums"
)
var _RelationsValues = []Relations{0, 1, 2, 3, 4, 5, 6}
// RelationsN is the highest valid value for type Relations, plus one.
const RelationsN Relations = 7
var _RelationsValueMap = map[string]Relations{`NoRel`: 0, `RightOf`: 1, `LeftOf`: 2, `Behind`: 3, `FrontOf`: 4, `Above`: 5, `Below`: 6}
var _RelationsDescMap = map[Relations]string{0: ``, 1: ``, 2: ``, 3: ``, 4: ``, 5: ``, 6: ``}
var _RelationsMap = map[Relations]string{0: `NoRel`, 1: `RightOf`, 2: `LeftOf`, 3: `Behind`, 4: `FrontOf`, 5: `Above`, 6: `Below`}
// String returns the string representation of this Relations value.
func (i Relations) String() string { return enums.String(i, _RelationsMap) }
// SetString sets the Relations value from its string representation,
// and returns an error if the string is invalid.
func (i *Relations) SetString(s string) error {
return enums.SetString(i, s, _RelationsValueMap, "Relations")
}
// Int64 returns the Relations value as an int64.
func (i Relations) Int64() int64 { return int64(i) }
// SetInt64 sets the Relations value from an int64.
func (i *Relations) SetInt64(in int64) { *i = Relations(in) }
// Desc returns the description of the Relations value.
func (i Relations) Desc() string { return enums.Desc(i, _RelationsDescMap) }
// RelationsValues returns all possible values for the type Relations.
func RelationsValues() []Relations { return _RelationsValues }
// Values returns all possible values for the type Relations.
func (i Relations) Values() []enums.Enum { return enums.Values(_RelationsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i Relations) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *Relations) UnmarshalText(text []byte) error {
return enums.UnmarshalText(i, text, "Relations")
}
var _XAlignsValues = []XAligns{0, 1, 2}
// XAlignsN is the highest valid value for type XAligns, plus one.
const XAlignsN XAligns = 3
var _XAlignsValueMap = map[string]XAligns{`Left`: 0, `Middle`: 1, `Right`: 2}
var _XAlignsDescMap = map[XAligns]string{0: ``, 1: ``, 2: ``}
var _XAlignsMap = map[XAligns]string{0: `Left`, 1: `Middle`, 2: `Right`}
// String returns the string representation of this XAligns value.
func (i XAligns) String() string { return enums.String(i, _XAlignsMap) }
// SetString sets the XAligns value from its string representation,
// and returns an error if the string is invalid.
func (i *XAligns) SetString(s string) error {
return enums.SetString(i, s, _XAlignsValueMap, "XAligns")
}
// Int64 returns the XAligns value as an int64.
func (i XAligns) Int64() int64 { return int64(i) }
// SetInt64 sets the XAligns value from an int64.
func (i *XAligns) SetInt64(in int64) { *i = XAligns(in) }
// Desc returns the description of the XAligns value.
func (i XAligns) Desc() string { return enums.Desc(i, _XAlignsDescMap) }
// XAlignsValues returns all possible values for the type XAligns.
func XAlignsValues() []XAligns { return _XAlignsValues }
// Values returns all possible values for the type XAligns.
func (i XAligns) Values() []enums.Enum { return enums.Values(_XAlignsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i XAligns) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *XAligns) UnmarshalText(text []byte) error { return enums.UnmarshalText(i, text, "XAligns") }
var _YAlignsValues = []YAligns{0, 1, 2}
// YAlignsN is the highest valid value for type YAligns, plus one.
const YAlignsN YAligns = 3
var _YAlignsValueMap = map[string]YAligns{`Front`: 0, `Center`: 1, `Back`: 2}
var _YAlignsDescMap = map[YAligns]string{0: ``, 1: ``, 2: ``}
var _YAlignsMap = map[YAligns]string{0: `Front`, 1: `Center`, 2: `Back`}
// String returns the string representation of this YAligns value.
func (i YAligns) String() string { return enums.String(i, _YAlignsMap) }
// SetString sets the YAligns value from its string representation,
// and returns an error if the string is invalid.
func (i *YAligns) SetString(s string) error {
return enums.SetString(i, s, _YAlignsValueMap, "YAligns")
}
// Int64 returns the YAligns value as an int64.
func (i YAligns) Int64() int64 { return int64(i) }
// SetInt64 sets the YAligns value from an int64.
func (i *YAligns) SetInt64(in int64) { *i = YAligns(in) }
// Desc returns the description of the YAligns value.
func (i YAligns) Desc() string { return enums.Desc(i, _YAlignsDescMap) }
// YAlignsValues returns all possible values for the type YAligns.
func YAlignsValues() []YAligns { return _YAlignsValues }
// Values returns all possible values for the type YAligns.
func (i YAligns) Values() []enums.Enum { return enums.Values(_YAlignsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i YAligns) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *YAligns) UnmarshalText(text []byte) error { return enums.UnmarshalText(i, text, "YAligns") }