MCPcopy Create free account
hub / github.com/golang/mobile / JNIMangle

Function JNIMangle

internal/importers/java/java.go:455–474  ·  view source on GitHub ↗

Mangle a name according to http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp16696 TODO: Support unicode characters

(s string)

Source from the content-addressed store, hash-verified

453//
454// TODO: Support unicode characters
455func JNIMangle(s string) string {
456 var m []byte
457 for i := 0; i < len(s); i++ {
458 switch c := s[i]; c {
459 case '.', '/':
460 m = append(m, '_')
461 case '$':
462 m = append(m, "_00024"...)
463 case '_':
464 m = append(m, "_1"...)
465 case ';':
466 m = append(m, "_2"...)
467 case '[':
468 m = append(m, "_3"...)
469 default:
470 m = append(m, c)
471 }
472 }
473 return string(m)
474}
475
476func (t *Type) Type() string {
477 switch t.Kind {

Callers 10

genJNIFuncSignatureMethod · 0.92
jniPkgNameMethod · 0.92
genJNIFieldMethod · 0.92
genJNIVarMethod · 0.92
genJNIConstructorMethod · 0.92
GenCMethod · 0.92
ImportMethod · 0.85
fillJNINamesMethod · 0.85
importClassesMethod · 0.85
scanClassMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected