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

Class CString

cpp/gdb_arrow.py:340–366  ·  view source on GitHub ↗

A `const char*` or similar value.

Source from the content-addressed store, hash-verified

338
339
340class CString:
341 """
342 A `const char*` or similar value.
343 """
344
345 def __init__(self, val):
346 self.val = val
347
348 def __bool__(self):
349 return int(data) != 0 and int(data[0]) != 0
350
351 @property
352 def data(self):
353 return self.val
354
355 def bytes_literal(self):
356 return self.val.lazy_string().value()
357
358 def string_literal(self):
359 # XXX use lazy_string() as well?
360 return string_literal(self.val)
361
362 def string(self):
363 return self.val.string()
364
365 def __format__(self, fmt):
366 return str(self.bytes_literal())
367
368
369# 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