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

Function getBTyNativeFormatDescriptor

bindings/python/cobj.cpp:342–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340namespace {
341
342std::string getBTyNativeFormatDescriptor(BasicType const* BTy)
343{
344#define HANDLE_BASICTY(DTy, CTy)\
345 case BasicType::DTy:\
346 return py::format_descriptor<CTy>::format();
347
348 switch (BTy->getBasicKind()) {
349 HANDLE_BASICTY(Bool, c_bool);
350 HANDLE_BASICTY(Char, c_char);
351 HANDLE_BASICTY(UChar, c_unsigned_char);
352 HANDLE_BASICTY(UShort, c_unsigned_short);
353 HANDLE_BASICTY(UInt, c_unsigned_int);
354 HANDLE_BASICTY(ULong, c_unsigned_long);
355 HANDLE_BASICTY(ULongLong, c_unsigned_long_long);
356 HANDLE_BASICTY(SChar, c_signed_char);
357 HANDLE_BASICTY(Short, c_short);
358 HANDLE_BASICTY(Int, c_int);
359 HANDLE_BASICTY(Long, c_long);
360 HANDLE_BASICTY(LongLong, c_long_long);
361 HANDLE_BASICTY(Float, c_float);
362 HANDLE_BASICTY(Double, c_double);
363#undef HANDLE_BASICTY
364 default:
365 break;
366 }
367 return std::to_string(BTy->getSize()) + "B";
368}
369
370std::string getPtrNativeFormatDescriptor(PointerType const*)
371{

Callers

nothing calls this directly

Calls 1

getSizeMethod · 0.45

Tested by

no test coverage detected