xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBStructuredDataExtensions.i (revision a0ca4af9455b844c5e094fc1b09b1390ffa979fc)
1 STRING_EXTENSION_OUTSIDE(SBStructuredData)
2 
3 %extend lldb::SBStructuredData {
4 #ifdef SWIGPYTHON
5     %pythoncode%{
6     def __int__(self):
7       return self.GetSignedInteger()
8 
9     def __len__(self):
10       '''Return the number of element in a lldb.SBStructuredData object.'''
11       return self.GetSize()
12 
13     def __iter__(self):
14         '''Iterate over all the elements in a lldb.SBStructuredData object.'''
15         return lldb_iter(self, 'GetSize', 'GetItemAtIndex')
16     %}
17 #endif
18 }
19