LLVM: SBStream.h Source File
Description: C++ source code API documentation for LLDB.
Keywords: LLDB,C++,doxygen,API,documentation

LLDB API Documentation

- Main Page
- Namespaces
- Classes
- Files

- File List

SBStream.h
Go to the documentation of this file.
1 //===-- SBStream.h ----------------------------------------------*- 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 #ifndef LLDB_SBStream_h_
11 #define LLDB_SBStream_h_
12
13 #include <stdio.h>
14
15 #include "lldb/API/SBDefines.h"
16
17 namespace lldb {
18
19 class LLDB_API SBStream {
20 public:
21 SBStream();
22
23 SBStream(SBStream &&rhs);
24
25 ~SBStream();
26
27 bool IsValid() const;
28
29 // If this stream is not redirected to a file, it will maintain a local
30 // cache for the stream data which can be accessed using this accessor.
31 const char *GetData();
32
33 // If this stream is not redirected to a file, it will maintain a local
34 // cache for the stream output whose length can be accessed using this
35 // accessor.
36 size_t GetSize();
37
38 void Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
39
40 void RedirectToFile(const char *path, bool append);
41
42 void RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership);
43
44 void RedirectToFileDescriptor(int fd, bool transfer_fh_ownership);
45
46 // If the stream is redirected to a file, forget about the file and if
47 // ownership of the file was transferred to this object, close the file.
48 // If the stream is backed by a local cache, clear this cache.
49 void Clear();
50
51 protected:
52 friend class SBAddress;
53 friend class SBBlock;
54 friend class SBBreakpoint;
55 friend class SBBreakpointLocation;
56 friend class SBCommandReturnObject;
57 friend class SBCompileUnit;
58 friend class SBData;
59 friend class SBDebugger;
60 friend class SBDeclaration;
61 friend class SBEvent;
62 friend class SBFileSpec;
63 friend class SBFileSpecList;
64 friend class SBFrame;
65 friend class SBFunction;
66 friend class SBInstruction;
67 friend class SBInstructionList;
68 friend class SBLineEntry;
69 friend class SBMemoryRegionInfo;
70 friend class SBModule;
71 friend class SBModuleSpec;
72 friend class SBModuleSpecList;
73 friend class SBProcess;
74 friend class SBSection;
75 friend class SBSourceManager;
76 friend class SBStructuredData;
77 friend class SBSymbol;
78 friend class SBSymbolContext;
79 friend class SBSymbolContextList;
80 friend class SBTarget;
81 friend class SBThread;
82 friend class SBThreadPlan;
83 friend class SBType;
84 friend class SBTypeEnumMember;
85 friend class SBTypeMemberFunction;
86 friend class SBTypeMember;
87 friend class SBValue;
88 friend class SBWatchpoint;
89
90 lldb_private::Stream *operator->();
91
92 lldb_private::Stream *get();
93
94 lldb_private::Stream &ref();
95
96 private:
97 DISALLOW_COPY_AND_ASSIGN(SBStream);
98 std::unique_ptr<lldb_private::Stream> m_opaque_ap;
99 bool m_is_file;
100 };
101
102 } // namespace lldb
103
104 #endif // LLDB_SBStream_h_
lldb::SBThread
Definition: SBThread.h:21
lldb::SBStream
class LLDB_API SBStream
Definition: SBDefines.h:72
lldb::SBMemoryRegionInfo
Definition: SBMemoryRegionInfo.h:18
lldb::SBSymbolContext
Definition: SBSymbolContext.h:23
lldb::SBBreakpoint
Definition: SBBreakpoint.h:17
lldb::SBData
Definition: SBData.h:17
lldb::SBFileSpecList
Definition: SBFileSpecList.h:18
lldb::SBType
Definition: SBType.h:101
lldb::SBFrame
Definition: SBFrame.h:18
SBDefines.h
lldb::SBStructuredData
Definition: SBStructuredData.h:18
lldb::SBSymbol
Definition: SBSymbol.h:20
lldb::SBSymbolContextList
Definition: SBSymbolContextList.h:18
lldb::SBTypeMember
Definition: SBType.h:19
lldb::SBTypeEnumMember
Definition: SBTypeEnumMember.h:18
lldb::SBValue
Definition: SBValue.h:22
lldb::SBBlock
Definition: SBBlock.h:20
lldb::SBInstruction
Definition: SBInstruction.h:26
lldb::SBModuleSpecList
Definition: SBModuleSpec.h:93
lldb::SBDeclaration
Definition: SBDeclaration.h:19
lldb::SBLineEntry
Definition: SBLineEntry.h:19
lldb::SBCompileUnit
Definition: SBCompileUnit.h:18
lldb::SBAddress
Definition: SBAddress.h:18
lldb::SBFileSpec
Definition: SBFileSpec.h:17
lldb::SBModule
Definition: SBModule.h:21
lldb::SBDebugger
Definition: SBDebugger.h:35
lldb::SBFunction
Definition: SBFunction.h:19
lldb::SBModuleSpec
Definition: SBModuleSpec.h:18
lldb::SBProcess
Definition: SBProcess.h:23
lldb::SBInstructionList
Definition: SBInstructionList.h:19
lldb::SBEvent
Definition: SBEvent.h:22
lldb::SBThreadPlan
Definition: SBThreadPlan.h:19
lldb::SBSourceManager
Definition: SBSourceManager.h:19
lldb::SBSection
Definition: SBSection.h:18
lldb::SBTypeMemberFunction
Definition: SBType.h:58
lldb::SBStream
Definition: SBStream.h:19
lldb::SBBreakpointLocation
Definition: SBBreakpointLocation.h:18
lldb::SBCommandReturnObject
Definition: SBCommandReturnObject.h:25
lldb::SBTarget
Definition: SBTarget.h:34
lldb::SBWatchpoint
Definition: SBWatchpoint.h:17