-
Notifications
You must be signed in to change notification settings - Fork 0
/
textbufflags_string.go
42 lines (34 loc) · 1.19 KB
/
textbufflags_string.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
// Code generated by "stringer -type=TextBufFlags"; DO NOT EDIT.
package giv
import (
"errors"
"strconv"
)
var _ = errors.New("dummy error")
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[TextBufAutoSaving-24]
_ = x[TextBufMarkingUp-25]
_ = x[TextBufChanged-26]
_ = x[TextBufFileModOk-27]
_ = x[TextBufFlagsN-28]
}
const _TextBufFlags_name = "TextBufAutoSavingTextBufMarkingUpTextBufChangedTextBufFileModOkTextBufFlagsN"
var _TextBufFlags_index = [...]uint8{0, 17, 33, 47, 63, 76}
func (i TextBufFlags) String() string {
i -= 24
if i < 0 || i >= TextBufFlags(len(_TextBufFlags_index)-1) {
return "TextBufFlags(" + strconv.FormatInt(int64(i+24), 10) + ")"
}
return _TextBufFlags_name[_TextBufFlags_index[i]:_TextBufFlags_index[i+1]]
}
func StringToTextBufFlags(s string) (TextBufFlags, error) {
for i := 0; i < len(_TextBufFlags_index)-1; i++ {
if s == _TextBufFlags_name[_TextBufFlags_index[i]:_TextBufFlags_index[i+1]] {
return TextBufFlags(i + 24), nil
}
}
return 0, errors.New("String: " + s + " is not a valid option for type: TextBufFlags")
}