xref: /llvm-project/lldb/bindings/interface/SBStreamDocstrings.i (revision 662548c82683bd8657a3179afee693c4965a3dfd)
1*662548c8SAlex Langford %feature("docstring",
2*662548c8SAlex Langford "Represents a destination for streaming data output to. By default, a string
3*662548c8SAlex Langford stream is created.
4*662548c8SAlex Langford 
5*662548c8SAlex Langford For example (from test/source-manager/TestSourceManager.py), ::
6*662548c8SAlex Langford 
7*662548c8SAlex Langford         # Create the filespec for 'main.c'.
8*662548c8SAlex Langford         filespec = lldb.SBFileSpec('main.c', False)
9*662548c8SAlex Langford         source_mgr = self.dbg.GetSourceManager()
10*662548c8SAlex Langford         # Use a string stream as the destination.
11*662548c8SAlex Langford         stream = lldb.SBStream()
12*662548c8SAlex Langford         source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
13*662548c8SAlex Langford                                                      self.line,
14*662548c8SAlex Langford                                                      2, # context before
15*662548c8SAlex Langford                                                      2, # context after
16*662548c8SAlex Langford                                                      '=>', # prefix for current line
17*662548c8SAlex Langford                                                      stream)
18*662548c8SAlex Langford 
19*662548c8SAlex Langford         #    2
20*662548c8SAlex Langford         #    3    int main(int argc, char const *argv[]) {
21*662548c8SAlex Langford         # => 4        printf('Hello world.\\n'); // Set break point at this line.
22*662548c8SAlex Langford         #    5        return 0;
23*662548c8SAlex Langford         #    6    }
24*662548c8SAlex Langford         self.expect(stream.GetData(), 'Source code displayed correctly',
25*662548c8SAlex Langford                     exe=False,
26*662548c8SAlex Langford             patterns = ['=> %d.*Hello world' % self.line])"
27*662548c8SAlex Langford ) lldb::SBStream;
28*662548c8SAlex Langford 
29*662548c8SAlex Langford %feature("docstring", "
30*662548c8SAlex Langford     If this stream is not redirected to a file, it will maintain a local
31*662548c8SAlex Langford     cache for the stream data which can be accessed using this accessor."
32*662548c8SAlex Langford ) lldb::SBStream::GetData;
33*662548c8SAlex Langford 
34*662548c8SAlex Langford %feature("docstring", "
35*662548c8SAlex Langford     If this stream is not redirected to a file, it will maintain a local
36*662548c8SAlex Langford     cache for the stream output whose length can be accessed using this
37*662548c8SAlex Langford     accessor."
38*662548c8SAlex Langford ) lldb::SBStream::GetSize;
39*662548c8SAlex Langford 
40*662548c8SAlex Langford %feature("docstring", "
41*662548c8SAlex Langford     If the stream is redirected to a file, forget about the file and if
42*662548c8SAlex Langford     ownership of the file was transferred to this object, close the file.
43*662548c8SAlex Langford     If the stream is backed by a local cache, clear this cache."
44*662548c8SAlex Langford ) lldb::SBStream::Clear;
45