MCPcopy Create free account
hub / github.com/enthought/comtypes / PointerType

Method PointerType

comtypes/tools/codegenerator/codegenerator.py:525–547  ·  view source on GitHub ↗
(self, tp: typedesc.PointerType)

Source from the content-addressed store, hash-verified

523 self.imports.add("comtypes.automation", "_midlSAFEARRAY")
524
525 def PointerType(self, tp: typedesc.PointerType) -> None:
526 if type(tp.typ) is typedesc.ComInterface:
527 # this defines the class
528 self.generate(tp.typ.get_head())
529 # this defines the _methods_
530 self.more.add(tp.typ)
531 elif type(tp.typ) is typedesc.PointerType:
532 self.generate(tp.typ)
533 elif type(tp.typ) in (typedesc.Union, typedesc.Structure):
534 self.generate(tp.typ.get_head())
535 self.more.add(tp.typ)
536 elif type(tp.typ) is typedesc.Typedef:
537 self.generate(tp.typ)
538 else:
539 self.generate(tp.typ)
540 if not ASSUME_STRINGS:
541 return
542 real_type = get_real_type(tp.typ)
543 if isinstance(real_type, typedesc.FundamentalType):
544 if real_type.name == "char":
545 self.declarations.add("STRING", "c_char_p")
546 elif real_type.name == "wchar_t":
547 self.declarations.add("WSTRING", "c_wchar_p")
548
549 def CoClass(self, coclass: typedesc.CoClass) -> None:
550 self.imports.add("comtypes", "GUID")

Callers 1

PTRFunction · 0.80

Calls 4

generateMethod · 0.95
get_real_typeFunction · 0.90
get_headMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected