1 //===-- SWIG Interface for SBStream -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
15 "Represents a destination for streaming data output to. By default, a string
18 For example (from test/source-manager/TestSourceManager.py),
20 # Create the filespec for 'main.c'.
21 filespec = lldb.SBFileSpec('main.c', False)
22 source_mgr = self.dbg.GetSourceManager()
23 # Use a string stream as the destination.
24 stream = lldb.SBStream()
25 source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
29 '=>', # prefix for current line
33 # 3 int main(int argc, char const *argv[]) {
34 # => 4 printf('Hello world.\\n'); // Set break point at this line.
37 self.expect(stream.GetData(), 'Source code displayed correctly',
39 patterns = ['=> %d.*Hello world' % self.line])
52 %feature("docstring", "
53 //--------------------------------------------------------------------------
54 /// If this stream is not redirected to a file, it will maintain a local
55 /// cache for the stream data which can be accessed using this accessor.
56 //--------------------------------------------------------------------------
61 %feature("docstring", "
62 //--------------------------------------------------------------------------
63 /// If this stream is not redirected to a file, it will maintain a local
64 /// cache for the stream output whose length can be accessed using this
66 //--------------------------------------------------------------------------
71 // wrapping the variadic Printf() with a plain Print()
72 // because it is hard to support varargs in SWIG bridgings
74 void Print (const char* str)
76 self->Printf("%s", str);
81 RedirectToFile (const char *path, bool append);
84 RedirectToFileHandle (FILE *fh, bool transfer_fh_ownership);
87 RedirectToFileDescriptor (int fd, bool transfer_fh_ownership);
89 %feature("docstring", "
90 //--------------------------------------------------------------------------
91 /// If the stream is redirected to a file, forget about the file and if
92 /// ownership of the file was transferred to this object, close the file.
93 /// If the stream is backed by a local cache, clear this cache.
94 //--------------------------------------------------------------------------