MCPcopy Create free account
hub / github.com/KDE/kdevelop / QByteArraySummaryProvider

Function QByteArraySummaryProvider

plugins/lldb/formatters/qt.py:253–268  ·  view source on GitHub ↗
(valobj, internal_dict)

Source from the content-addressed store, hash-verified

251
252
253def QByteArraySummaryProvider(valobj, internal_dict):
254 if valobj.IsValid():
255 content = valobj.GetChildMemberWithName('(content)')
256 if content.IsValid():
257 summary = content.GetSummary()
258 if summary is not None:
259 # unlike QString, we quoted the (content) twice to preserve our own quotation,
260 # must undo the quotation done by GetSummary
261 return 'b' + unquote(summary)
262 # Something wrong with our synthetic provider, get the content by ourselves
263 printable, _, _ = printableQByteArray(valobj)
264 if printable is not None:
265 # first replace " to \", and surround by "", no need to escape other things which
266 # are handled in printableQByteArray.
267 return 'b"{}"'.format(printable.replace('"', '\\"'))
268 return '<Invalid>'
269
270
271class QByteArrayFormatter(HiddenMemberProvider):

Callers

nothing calls this directly

Calls 5

unquoteFunction · 0.90
printableQByteArrayFunction · 0.85
IsValidMethod · 0.80
formatMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected