xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBStructuredDataExtensions.i (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
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