CommandReturnObject.h revision 24943d2ee8bfaa7cf5893e4709143924157a5c1e
1//===-- CommandReturnObject.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 liblldb_CommandReturnObject_h_
11#define liblldb_CommandReturnObject_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/lldb-private.h"
18#include "lldb/Core/STLUtils.h"
19#include "lldb/Core/StreamString.h"
20
21namespace lldb_private {
22
23
24class CommandReturnObject
25{
26public:
27
28    CommandReturnObject ();
29
30    ~CommandReturnObject ();
31
32    StreamString &
33    GetOutputStream ();
34
35    StreamString &
36    GetErrorStream ();
37
38    void
39    Clear();
40
41    void
42    AppendMessage (const char *in_string, int len = -1);
43
44    void
45    AppendMessageWithFormat (const char *format, ...);
46
47    void
48    AppendRawWarning (const char *in_string, int len = -1);
49
50    void
51    AppendWarning (const char *in_string, int len = -1);
52
53    void
54    AppendWarningWithFormat (const char *format, ...);
55
56    void
57    AppendError (const char *in_string, int len = -1);
58
59    void
60    AppendRawError (const char *in_string, int len = -1);
61
62    void
63    AppendErrorWithFormat (const char *format, ...);
64
65    lldb::ReturnStatus
66    GetStatus();
67
68    void
69    SetStatus (lldb::ReturnStatus status);
70
71    bool
72    Succeeded ();
73
74    bool
75    HasResult ();
76
77    bool GetDidChangeProcessState ();
78
79    void SetDidChangeProcessState (bool b);
80
81private:
82    StreamString m_output_stream;
83    StreamString m_error_stream;
84    lldb::ReturnStatus m_status;
85    bool m_did_change_process_state;
86};
87
88} // namespace lldb_private
89
90#endif  // liblldb_CommandReturnObject_h_
91