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;
65 friend class SBTarget;
67 friend class SBWatchpoint;
68 friend class SBBreakpoint;
69 friend class SBBreakpointLocation;
70 friend class SBBreakpointName;
72 lldb_private::Status *get();
74 lldb_private::Status *operator->();
76 const lldb_private::Status &operator*() const;
78 lldb_private::Status &ref();
80 void SetError(const lldb_private::Status &lldb_error);
83 std::unique_ptr<lldb_private::Status> m_opaque_ap;
85 void CreateIfNeeded();
90 #endif // LLDB_SBError_h_