-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathKotlinTransform.go
More file actions
31 lines (27 loc) · 878 Bytes
/
KotlinTransform.go
File metadata and controls
31 lines (27 loc) · 878 Bytes
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
package main
import (
"regexp"
"strings"
)
func kotlinTransformKeyToKotlinVarName(key string) string {
reg, _ := regexp.Compile(`(_).`)
workingKey := reg.ReplaceAllStringFunc(key, func(rKey string) string {
return strings.ToUpper(rKey)
})
return strings.Replace(workingKey, "_","",-1)
}
func getKotlinClassName(value *StringKeys, config *StringCheeseConfig) string {
if (value.languageId == LANGUAGE_ID_NONE) {
return config.rootLanguageIdToUse + "_" + config.className
}
return value.languageId + "_" + config.className
}
func getKotlinMemberName(value *StringKeys, config *StringCheeseConfig) string {
if (value.languageId == LANGUAGE_ID_NONE) {
return config.rootLanguageIdToUse + "_" + config.className
}
return value.languageId + "_" + config.className
}
func getKotlinFileName(config *StringCheeseConfig) string {
return config.className + ".kt"
}