public short FindMungedName(Method *meth) { short imax = numMethodMaps; short imin = 1; short c = meth->classId; short searchId = (short)(meth - methods); while (imax >= imin) { short icur = (short)((imin + imax) / 2); int icmp = methodMaps[icur].classId - c; if (icmp == 0) { // move to the beginning of this class while (methodMaps[icur - 1].classId == c) { icur--; } // we found the class, let's go hunt for the munged name while (methodMaps[icur].classId == c) { if (methodMaps[icur].method == searchId) { return(methodMaps[icur].name); } if (this.methodMaps[icur].method < 0) { for (short *id = this.ambiguousMethodList + (-this.methodMaps[icur].method); *id > 0; id++) { if (*id == searchId) { return(this.methodMaps[icur].name); } } } icur++; } } if (icmp > 0) { imax = (short)(icur - 1); } else { imin = (short)(icur + 1); } } return(0); }
public string GetMethodSignature(Method *meth) { StringBuilder str = new StringBuilder(); str.Append(ByteArrayManager.GetString(methodNames[meth->name])); str.Append('('); for (short *typeIndex = argumentList + meth->args; *typeIndex > 0;) { str.Append(ByteArrayManager.GetString(types[*typeIndex].name)); if (*(++typeIndex) > 0) { str.Append(", "); } } str.Append(')'); if ((meth->flags & (ushort)MethodFlags.mf_const) != 0) { str.Append(" const"); } return(str.ToString()); }
public string GetMethodSignature(short index) { Method *meth = methods + index; return(GetMethodSignature(meth)); }