MCPcopy Create free account
hub / github.com/apache/arrow / __init__

Method __init__

cpp/gdb_arrow.py:465–474  ·  view source on GitHub ↗
(self, val)

Source from the content-addressed store, hash-verified

463 """
464
465 def __init__(self, val):
466 self.val = val
467 try:
468 # libstdc++ internals
469 self._data = val['_M_dataplus']['_M_p']
470 self._size = val['_M_string_length']
471 except gdb.error:
472 # fallback for other C++ standard libraries
473 self._data = gdb.parse_and_eval(f"{for_evaluation(val)}.c_str()")
474 self._size = gdb.parse_and_eval(f"{for_evaluation(val)}.size()")
475
476 def __bool__(self):
477 return self._size != 0

Callers

nothing calls this directly

Calls 1

for_evaluationFunction · 0.85

Tested by

no test coverage detected