Пример #1
0
        public static JniSignature Parse(string signature)
        {
            var idx = signature.LastIndexOf(')') + 1;
            var jni = new JniSignature(JniTypeName.Parse(signature.Substring(idx)));

            // Strip out return type
            if (signature.StartsWith("(", StringComparison.Ordinal))
            {
                var e = signature.IndexOf(')');
                signature = signature.Substring(1, e >= 0 ? e - 1 : signature.Length - 1);
            }

            // Parse parameters
            var i = 0;

            while (i < signature.Length)
            {
                var t = JniTypeName.Parse(signature.Substring(i));

                jni.Parameters.Add(t);
                i += t.Jni.Length;
            }

            return(jni);
        }
Пример #2
0
 public JniSignature(JniTypeName returnType, params JniTypeName[] parameterTypes)
 {
     Return = returnType;
     Parameters.AddRange(parameterTypes);
 }