forked from ixmilia/dxf-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodePairHelper.go
90 lines (88 loc) · 2.23 KB
/
codePairHelper.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
package dxf
func codeTypeName(code int) string {
// official code types
if between(code, 0, 9) {
return "String"
} else if between(code, 10, 39) {
return "Double"
} else if between(code, 40, 59) {
return "Double"
} else if between(code, 60, 79) {
return "Short"
} else if between(code, 90, 99) {
return "Int"
} else if between(code, 100, 102) {
return "String"
} else if code == 105 {
return "String"
} else if between(code, 110, 119) {
return "Double"
} else if between(code, 120, 129) {
return "Double"
} else if between(code, 130, 139) {
return "Double"
} else if between(code, 140, 149) {
return "Double"
} else if between(code, 160, 169) {
return "Long"
} else if between(code, 170, 179) {
return "Short"
} else if between(code, 210, 239) {
return "Double"
} else if between(code, 270, 279) {
return "Short"
} else if between(code, 280, 289) {
return "Short"
} else if between(code, 290, 299) {
return "Bool"
} else if between(code, 300, 309) {
return "String"
} else if between(code, 310, 319) {
return "String"
} else if between(code, 320, 329) {
return "String"
} else if between(code, 330, 369) {
return "String"
} else if between(code, 370, 379) {
return "Short"
} else if between(code, 380, 389) {
return "Short"
} else if between(code, 390, 399) {
return "String"
} else if between(code, 400, 409) {
return "Short"
} else if between(code, 410, 419) {
return "String"
} else if between(code, 420, 429) {
return "Int"
} else if between(code, 430, 439) {
return "String"
} else if between(code, 440, 449) {
return "Int"
} else if between(code, 450, 459) {
return "Int"
} else if between(code, 460, 469) {
return "Double"
} else if between(code, 470, 479) {
return "String"
} else if between(code, 480, 481) {
return "String"
} else if code == 999 {
return "String"
} else if between(code, 1000, 1009) {
return "String"
} else if between(code, 1010, 1059) {
return "Double"
} else if between(code, 1060, 1070) {
return "Short"
} else if code == 1071 {
return "Int"
} else if code == 250 { // UNOFFICIAL: used in POLYLINEs by CLO
return "Short"
} else {
return "Unknown"
}
}
func between(val, lower, upper int) bool {
return val >= lower && val <= upper
}