blob: 56543609ac92eefd1a34ad3a8570dcb4560137a8 [file] [log] [blame]
Johnny Chen5cb6cab2011-07-19 22:41:47 +00001//===-- SWIG Interface for SBStream -----------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include <stdio.h>
11
12namespace lldb {
13
14class SBStream
15{
16public:
17
18 SBStream ();
19
20 ~SBStream ();
21
22 bool
23 IsValid() const;
24
25 // If this stream is not redirected to a file, it will maintain a local
26 // cache for the stream data which can be accessed using this accessor.
27 const char *
28 GetData ();
29
30 // If this stream is not redirected to a file, it will maintain a local
31 // cache for the stream output whose length can be accessed using this
32 // accessor.
33 size_t
34 GetSize();
35
36 void
37 Printf (const char *format, ...);
38
39 void
40 RedirectToFile (const char *path, bool append);
41
42 void
43 RedirectToFileHandle (FILE *fh, bool transfer_fh_ownership);
44
45 void
46 RedirectToFileDescriptor (int fd, bool transfer_fh_ownership);
47
48 // If the stream is redirected to a file, forget about the file and if
49 // ownership of the file was transfered to this object, close the file.
50 // If the stream is backed by a local cache, clear this cache.
51 void
52 Clear ();
53};
54
55} // namespace lldb