Package lldb :: Class SBStream |
[hide private]
[frames] | no frames]

# Class SBStream

source code

        Represents a destination for streaming data output to. By default, a string
        stream is created.

        For example (from test/source-manager/TestSourceManager.py),

                # Create the filespec for 'main.c'.
                filespec = lldb.SBFileSpec('main.c', False)
                source_mgr = self.dbg.GetSourceManager()
                # Use a string stream as the destination.
                stream = lldb.SBStream()
                source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
                                                             self.line,
                                                             2, # context before
                                                             2, # context after
                                                             '=>', # prefix for current line
                                                             stream)

                #    2
                #    3    int main(int argc, char const *argv[]) {
                # => 4        printf('Hello world.
    '); // Set break point at this line.
                #    5        return 0;
                #    6    }
                self.expect(stream.GetData(), 'Source code displayed correctly',
                            exe=False,
                    patterns = ['=> %d.*Hello world' % self.line])

Instance Methods | [hide private]
__setattr__(self, name, value) x.__setattr__('name', value) <==> x.name = value | source code
__getattr__(self, name) | source code
__repr__(self) repr(x) | source code
__init__(self) __init__(lldb::SBStream self) -> SBStream | source code
__swig_destroy__(...) delete_SBStream(SBStream self) |
__del__(self) | source code
__nonzero__(self) | source code
IsValid(self) IsValid(SBStream self) -> bool | source code
GetData(self) GetData(SBStream self) -> str const * | source code
GetSize(self) GetSize(SBStream self) -> size_t | source code
Print(self, *args) Print(SBStream self, str const * str) | source code
RedirectToFile(self, *args) RedirectToFile(SBStream self, str const * path, bool append) | source code
RedirectToFileHandle(self, *args) RedirectToFileHandle(SBStream self, FILE * fh, bool transfer_fh_ownership) | source code
RedirectToFileDescriptor(self, *args) RedirectToFileDescriptor(SBStream self, int fd, bool transfer_fh_ownership) | source code
Clear(self) Clear(SBStream self) | source code
write(self, *args) write(SBStream self, str const * str) | source code
flush(self) flush(SBStream self) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
| __swig_setmethods__ = ``{``}``
| __swig_getmethods__ = ``{``}``

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __setattr__(self, name, value) | source code
x.__setattr__('name', value) <==> x.name = value Overrides: object.__setattr__ (inherited documentation)

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### __init__(self) (Constructor) | source code
__init__(lldb::SBStream self) -> SBStream Overrides: object.__init__

### GetData(self) | source code
GetData(SBStream self) -> str const * If this stream is not redirected to a file, it will maintain a local cache for the stream data which can be accessed using this accessor.

### GetSize(self) | source code
GetSize(SBStream self) -> size_t If this stream is not redirected to a file, it will maintain a local cache for the stream output whose length can be accessed using this accessor.

### Clear(self) | source code
Clear(SBStream self) If the stream is redirected to a file, forget about the file and if ownership of the file was transferred to this object, close the file. If the stream is backed by a local cache, clear this cache.