]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/tools/lldb-mi/MICmnBase.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / tools / lldb-mi / MICmnBase.h
1 //===-- MICmnBase.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #pragma once
10
11 // In-house headers:
12 #include "MIDataTypes.h"
13 #include "MIUtilString.h"
14
15 // Declarations:
16 class CMICmnLog;
17
18 //++
19 //============================================================================
20 // Details: MI common code implementation base class.
21 //--
22 class CMICmnBase {
23   // Methods:
24 public:
25   /* ctor */ CMICmnBase();
26
27   bool HaveErrorDescription() const;
28   const CMIUtilString &GetErrorDescription() const;
29   void SetErrorDescription(const CMIUtilString &vrTxt) const;
30   void SetErrorDescriptionn(const char *vFormat, ...) const;
31   void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
32   void ClrErrorDescription() const;
33
34   // Overrideable:
35 public:
36   /* dtor */ virtual ~CMICmnBase();
37
38   // Attributes:
39 protected:
40   mutable CMIUtilString m_strMILastErrorDescription;
41   bool m_bInitialized; // True = yes successfully initialized, false = no yet or
42                        // failed
43   CMICmnLog *m_pLog;   // Allow all derived classes to use the logger
44   MIint m_clientUsageRefCnt; // Count of client using *this object so not
45                              // shutdown() object to early
46 };