1 //===-- SBError.h -----------------------------------------------*- 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 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBError_h_
11 #define LLDB_SBError_h_
13 #include "lldb/API/SBDefines.h"
17 class LLDB_API SBError {
21 SBError(const lldb::SBError &rhs);
25 const SBError &operator=(const lldb::SBError &rhs);
27 const char *GetCString() const;
35 uint32_t GetError() const;
37 lldb::ErrorType GetType() const;
39 void SetError(uint32_t err, lldb::ErrorType type);
41 void SetErrorToErrno();
43 void SetErrorToGenericError();
45 void SetErrorString(const char *err_str);
47 int SetErrorStringWithFormat(const char *format, ...)
48 __attribute__((format(printf, 2, 3)));
52 bool GetDescription(lldb::SBStream &description);
55 friend class SBCommandReturnObject;
57 friend class SBDebugger;
58 friend class SBCommunication;
59 friend class SBHostOS;
60 friend class SBPlatform;
61 friend class SBProcess;
62 friend class SBStructuredData;
63 friend class SBThread;
64 friend class SBTarget;
66 friend class SBWatchpoint;
67 friend class SBBreakpoint;
68 friend class SBBreakpointLocation;
70 lldb_private::Error *get();
72 lldb_private::Error *operator->();
74 const lldb_private::Error &operator*() const;
76 lldb_private::Error &ref();
78 void SetError(const lldb_private::Error &lldb_error);
81 std::unique_ptr<lldb_private::Error> m_opaque_ap;
83 void CreateIfNeeded();
88 #endif // LLDB_SBError_h_