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