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

Class Property

commands/FBClassDump.py:397–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395
396
397class Property:
398 def __init__(self, json):
399 self.name = json["name"]
400 self.attributes_string = json["attributes_string"]
401 self.attributes = json["attributes"]
402
403 # https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html#//apple_ref/doc/uid/TP40008048-CH101-SW1
404 def prettyPrintString(self):
405 attrs = []
406 if self.attributes.has_key("N"):
407 attrs.append("nonatomic")
408 else:
409 attrs.append("atomic")
410
411 if self.attributes.has_key("&"):
412 attrs.append("strong")
413 elif self.attributes.has_key("C"):
414 attrs.append("copy")
415 elif self.attributes.has_key("W"):
416 attrs.append("weak")
417 else:
418 attrs.append("assign")
419
420 if self.attributes.has_key("R"):
421 attrs.append("readonly")
422
423 if self.attributes.has_key("G"):
424 attrs.append("getter={}".format(self.attributes["G"]))
425 if self.attributes.has_key("S"):
426 attrs.append("setter={}".format(self.attributes["S"]))
427
428 return "@property ({}) {} {};".format(
429 ", ".join(attrs), decode(self.attributes["T"]), self.name
430 )

Callers 1

getPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected