]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBError.h
Upgrade to OpenSSH 7.3p1.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / API / SBError.h
1 //===-- SBError.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_SBError_h_
11 #define LLDB_SBError_h_
12
13 #include "lldb/API/SBDefines.h"
14
15 namespace lldb {
16
17 class LLDB_API SBError {
18 public:
19     SBError ();
20
21     SBError (const lldb::SBError &rhs);
22
23     ~SBError();
24
25     const SBError &
26     operator =(const lldb::SBError &rhs);
27
28     const char *
29     GetCString () const;
30
31     void
32     Clear ();
33
34     bool
35     Fail () const;
36
37     bool
38     Success () const;
39
40     uint32_t
41     GetError () const;
42
43     lldb::ErrorType
44     GetType () const;
45
46     void
47     SetError (uint32_t err, lldb::ErrorType type);
48
49     void
50     SetErrorToErrno ();
51
52     void
53     SetErrorToGenericError ();
54
55     void
56     SetErrorString (const char *err_str);
57
58     int
59     SetErrorStringWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
60
61     bool
62     IsValid () const;
63
64     bool
65     GetDescription (lldb::SBStream &description);
66
67 protected:
68
69     friend class SBCommandReturnObject;
70     friend class SBData;
71     friend class SBDebugger;
72     friend class SBCommunication;
73     friend class SBHostOS;
74     friend class SBPlatform;
75     friend class SBProcess;
76     friend class SBThread;
77     friend class SBTarget;
78     friend class SBValue;
79     friend class SBWatchpoint;
80     friend class SBBreakpoint;
81     friend class SBBreakpointLocation;
82
83     lldb_private::Error *
84     get();
85
86     lldb_private::Error *
87     operator->();
88
89     const lldb_private::Error &
90     operator*() const;
91
92     lldb_private::Error &
93     ref();
94
95     void
96     SetError (const lldb_private::Error &lldb_error);
97
98 private:
99     std::unique_ptr<lldb_private::Error> m_opaque_ap;
100
101     void
102     CreateIfNeeded ();
103 };
104
105
106 } // namespace lldb
107
108 #endif // LLDB_SBError_h_