]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmnMIValueTuple.h
MFV r353613: 10731 zfs: NULL pointer errors
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmnMIValueTuple.h
1 //===-- MICmnMIValueTuple.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 "MICmnMIValue.h"
13 #include "MICmnMIValueConst.h"
14 #include "MICmnMIValueResult.h"
15
16 //++
17 //============================================================================
18 // Details: MI common code MI Result class. Part of the CMICmnMIValueTupleRecord
19 //          set of objects.
20 //          The syntax is as follows:
21 //          result-record ==>  [ token ] "^" result-class ( "," result )* nl
22 //          token = any sequence of digits
23 //          * = 0 to many
24 //          nl = CR | CR_LF
25 //          result-class ==> "done" | "running" | "connected" | "error" | "exit"
26 //          result ==> variable "=" value
27 //          value ==> const | tuple | list
28 //          const ==> c-string (7 bit iso c string content)
29 //          tuple ==>  "{}" | "{" result ( "," result )* "}"
30 //          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( ","
31 //          result )* "]"
32 //          More information see:
33 //          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
34 //--
35 class CMICmnMIValueTuple : public CMICmnMIValue {
36   // Methods:
37 public:
38   /* ctor */ CMICmnMIValueTuple();
39   /* ctor */ CMICmnMIValueTuple(const CMICmnMIValueResult &vResult);
40   /* ctor */ CMICmnMIValueTuple(const CMICmnMIValueResult &vResult,
41                                 const bool vbUseSpacing);
42   //
43   void Add(const CMICmnMIValueResult &vResult);
44   void Add(const CMICmnMIValueResult &vResult, const bool vbUseSpacing);
45   void Add(const CMICmnMIValueConst &vValue, const bool vbUseSpacing);
46   CMIUtilString ExtractContentNoBrackets() const;
47
48   // Overridden:
49 public:
50   // From CMICmnBase
51   /* dtor */ ~CMICmnMIValueTuple() override;
52
53   // Methods:
54 private:
55   void BuildTuple();
56   void BuildTuple(const CMICmnMIValueResult &vResult);
57   void BuildTuple(const CMIUtilString &vValue);
58
59   // Attributes:
60 private:
61   bool m_bSpaceAfterComma; // True = put space separators into the string, false
62                            // = no spaces used
63 };