| 595 | } |
| 596 | |
| 597 | py::memoryview CPointerObj::getMemoryViewCStr() |
| 598 | { |
| 599 | static constexpr auto CharKind = BasicType::getKind<char>(); |
| 600 | auto* PteeType = getPointeeType().getType(); |
| 601 | if (!isa<BasicType>(PteeType) || static_cast<BasicType const*>(PteeType)->getBasicKind() != CharKind) { |
| 602 | throw TypeError{"pointer must be a pointer to char*!"}; |
| 603 | } |
| 604 | const size_t Len = strlen((const char*)getPtr()); |
| 605 | return getMemoryViewObjects(Len); |
| 606 | } |
| 607 | |
| 608 | py::object CVarArgsFunction::call(py::args const& Args) const |
| 609 | { |