1 //===-- MICmnMIResultRecord.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 //===----------------------------------------------------------------------===//
13 #include "MICmnBase.h"
14 #include "MICmnMIValueResult.h"
15 #include "MIUtilString.h"
18 //============================================================================
19 // Details: MI common code MI Result Record class. A class that encapsulates
20 // MI result record data and the forming/format of data added to it.
21 // The syntax is as follows:
22 // result-record ==> [ token ] "^" result-class ( "," result )* nl
23 // token = any sequence of digits
26 // result-class ==> "done" | "running" | "connected" | "error" | "exit"
27 // result ==> variable "=" value
28 // value ==> const | tuple | list
29 // const ==> c-string (7 bit iso c string content) i.e. "all" inc
31 // tuple ==> "{}" | "{" result ( "," result )* "}"
32 // list ==> "[]" | "[" value ( "," value )* "]" | "[" result ( ","
35 // The result record can be retrieve at any time *this object is
36 // instantiated so unless work is done on *this result record then it
38 // possible to return a malformed result record. If nothing has been
40 // or added to *this MI result record object then text "<Invalid>" will
42 // More information see:
43 // http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
45 class CMICmnMIResultRecord : public CMICmnBase {
49 // Details: Enumeration of the result class for *this result record
52 eResultClass_Done = 0,
54 eResultClass_Connected,
61 /* ctor */ CMICmnMIResultRecord();
62 /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken,
63 ResultClass_e veType);
64 /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken,
66 const CMICmnMIValueResult &vValue);
68 const CMIUtilString &GetString() const;
69 void Add(const CMICmnMIValue &vMIValue);
74 /* dtor */ ~CMICmnMIResultRecord() override;
79 m_strResultRecord; // Holds the text version of the result record to date