-
Notifications
You must be signed in to change notification settings - Fork 0
/
byte_type.go
39 lines (33 loc) · 860 Bytes
/
byte_type.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
package strcase
type byteType int
type byteTypes []byteType
var byteTypeMap = map[byte]byteType{
'-': typeDash,
'_': typeUnderscore,
'.': typePeriod,
' ': typeSpace,
'\t': typeTab,
'\n': typeNewline,
}
var byteTypeList []byte
func init() {
for b := range byteTypeMap {
byteTypeList = append(byteTypeList, b)
}
}
const (
typeInit byteType = 1 << iota
typeAlpha byteType = 1 << iota
typeUpper byteType = 1 << iota
typeLower byteType = 1 << iota
typeNumber byteType = 1 << iota
typeDelimiter byteType = 1 << iota
typePeriod byteType = 1 << iota
typeDash byteType = 1 << iota
typeUnderscore byteType = 1 << iota
typeSpace byteType = 1 << iota
typeTab byteType = 1 << iota
typeNewline byteType = 1 << iota
typeUnknown byteType = 1 << iota
typeInvalid byteType = 1 << iota
)