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