MCPcopy Create free account
hub / github.com/aguinet/dragonffi / getMemoryViewCStr

Method getMemoryViewCStr

bindings/python/cobj.cpp:597–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597py::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
608py::object CVarArgsFunction::call(py::args const& Args) const
609{

Callers

nothing calls this directly

Calls 1

getTypeMethod · 0.45

Tested by

no test coverage detected