mirror of
https://github.com/mappu/miqt.git
synced 2025-02-02 03:20:25 +00:00
genbindings: better names for push_back(), fix_neg_rect()
This commit is contained in:
parent
d8145be2da
commit
28b6684004
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -116,7 +117,12 @@ func (nm CppMethod) SafeMethodName() string {
|
|||||||
tmp := replacer.Replace(nm.MethodName)
|
tmp := replacer.Replace(nm.MethodName)
|
||||||
|
|
||||||
// Also make the first letter uppercase so it becomes public in Go
|
// Also make the first letter uppercase so it becomes public in Go
|
||||||
return titleCase(tmp)
|
tmp = titleCase(tmp)
|
||||||
|
|
||||||
|
// Also replace any underscore_case with CamelCase
|
||||||
|
tmp = regexp.MustCompile(`_([a-z])`).ReplaceAllStringFunc(tmp, func(match string) string { return strings.ToUpper(match[1:]) })
|
||||||
|
|
||||||
|
return tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
type CppClass struct {
|
type CppClass struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user