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

Class CString

cpp/gdb_arrow.py:342–368  ·  view source on GitHub ↗

A `const char*` or similar value.

Source from the content-addressed store, hash-verified

340
341
342class CString:
343 """
344 A `const char*` or similar value.
345 """
346
347 def __init__(self, val):
348 self.val = val
349
350 def __bool__(self):
351 return int(data) != 0 and int(data[0]) != 0
352
353 @property
354 def data(self):
355 return self.val
356
357 def bytes_literal(self):
358 return self.val.lazy_string().value()
359
360 def string_literal(self):
361 # XXX use lazy_string() as well?
362 return string_literal(self.val)
363
364 def string(self):
365 return self.val.string()
366
367 def __format__(self, fmt):
368 return str(self.bytes_literal())
369
370
371# NOTE: gdb.parse_and_eval() is *slow* and calling it multiple times

Callers 1

_format_detailMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected