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;
71 lldb_private::Error *get();
73 lldb_private::Error *operator->();
75 const lldb_private::Error &operator*() const;
77 lldb_private::Error &ref();
79 void SetError(const lldb_private::Error &lldb_error);
82 std::unique_ptr<lldb_private::Error> m_opaque_ap;
84 void CreateIfNeeded();
89 #endif // LLDB_SBError_h_