MCPcopy Create free account
hub / github.com/facebook/chisel / Method

Class Method

commands/FBClassDump.py:328–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326
327
328class Method:
329 def __init__(self, json):
330 self.name = json["name"]
331 self.type_encoding = json["type_encoding"]
332 self.parameters_type = json["parameters_type"]
333 self.return_type = json["return_type"]
334 self.imp = self.toHex(json["implementation"])
335
336 def prettyPrintString(self):
337 argnum = len(self.parameters_type)
338 names = self.name.split(":")
339
340 # the argnum count must be bigger then 2, index 0 for self, index 1 for SEL
341 for i in range(2, argnum):
342 arg_type = self.parameters_type[i]
343 names[i - 2] = names[i - 2] + ":(" + decode(arg_type) + ")arg" + str(i - 2)
344
345 string = " ".join(names)
346 return "({}){}".format(decode(self.return_type), string)
347
348 def toHex(self, addr):
349 return hex(addr)
350
351 def __str__(self):
352 return (
353 "<Method:"
354 + self.oc_method
355 + "> "
356 + self.name
357 + " --- "
358 + self.type
359 + " --- "
360 + self.imp
361 )
362
363
364def getProperties(klass):

Callers 1

getMethodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected