Files
clang-p2996/lldb/bindings/interface/SBFileExtensions.i
Med Ismail Bennani f0731d5b61 Re-land "[lldb/docs] Silence warnings when generating website"
This reverts commit 18f1c1ace7 and fix the
build failure issues introduced because of the `STRING_EXTENSION_OUTSIDE`
swig macros.

Differential Revision: https://reviews.llvm.org/D159017

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-08-29 16:24:33 +01:00

56 lines
1.6 KiB
OpenEdge ABL

%extend lldb::SBFile {
static lldb::SBFile MakeBorrowed(lldb::FileSP BORROWED) {
return lldb::SBFile(BORROWED);
}
static lldb::SBFile MakeForcingIOMethods(lldb::FileSP FORCE_IO_METHODS) {
return lldb::SBFile(FORCE_IO_METHODS);
}
static lldb::SBFile MakeBorrowedForcingIOMethods(lldb::FileSP BORROWED_FORCE_IO_METHODS) {
return lldb::SBFile(BORROWED_FORCE_IO_METHODS);
}
#ifdef SWIGPYTHON
%pythoncode {
def __eq__(self, other):
return not self.__ne__(other)
def __int__(self):
pass
def __hex__(self):
pass
def __oct__(self):
pass
def __len__(self):
pass
def __iter__(self):
pass
@classmethod
def Create(cls, file, borrow=False, force_io_methods=False):
"""
Create a SBFile from a python file object, with options.
If borrow is set then the underlying file will
not be closed when the SBFile is closed or destroyed.
If force_scripting_io is set then the python read/write
methods will be called even if a file descriptor is available.
"""
if borrow:
if force_io_methods:
return cls.MakeBorrowedForcingIOMethods(file)
else:
return cls.MakeBorrowed(file)
else:
if force_io_methods:
return cls.MakeForcingIOMethods(file)
else:
return cls(file)
}
#endif
}