(self, t=None)
| 101 | return res |
| 102 | |
| 103 | def to_list(self, t=None): |
| 104 | if t is None: |
| 105 | if hasattr(self, "elt_type"): |
| 106 | t = self.elt_type |
| 107 | else: |
| 108 | raise ValueError("Missing type of the array") |
| 109 | if self.cDims != 1: |
| 110 | raise NotImplementedError("tagSAFEARRAY if dims != 1") |
| 111 | |
| 112 | nb_element = self.rgsabound[0].cElements |
| 113 | llbound = self.rgsabound[0].lLbound |
| 114 | if self.cbElements != ctypes.sizeof(t): |
| 115 | raise ValueError("Size of elements != sizeof(type)") |
| 116 | data = [t.from_address(self.pvData + (i + llbound) * ctypes.sizeof(t)).value for i in range(nb_element)] |
| 117 | return data |
| 118 | |
| 119 | #VT_VALUE_TO_TYPE = { |
| 120 | #VT_I2 : SHORT, |
no test coverage detected