1 //===-- MICmnMIResultRecord.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 #pragma once 11 12 // In-house headers: 13 #include "MICmnBase.h" 14 #include "MICmnMIValueResult.h" 15 #include "MIUtilString.h" 16 17 //++ 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 24 // * = 0 to many 25 // nl = CR | CR_LF 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 30 // quotes 31 // tuple ==> "{}" | "{" result ( "," result )* "}" 32 // list ==> "[]" | "[" value ( "," value )* "]" | "[" result ( "," 33 // result )* "]" 34 // 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 37 // is 38 // possible to return a malformed result record. If nothing has been 39 // set 40 // or added to *this MI result record object then text "<Invalid>" will 41 // be returned. 42 // More information see: 43 // http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html 44 //-- 45 class CMICmnMIResultRecord : public CMICmnBase { 46 // Enumerations: 47 public: 48 //++ 49 // Details: Enumeration of the result class for *this result record 50 //-- 51 enum ResultClass_e { 52 eResultClass_Done = 0, 53 eResultClass_Running, 54 eResultClass_Connected, 55 eResultClass_Error, 56 eResultClass_Exit 57 }; 58 59 // Methods: 60 public: 61 /* ctor */ CMICmnMIResultRecord(); 62 /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, 63 ResultClass_e veType); 64 /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, 65 ResultClass_e veType, 66 const CMICmnMIValueResult &vValue); 67 // 68 const CMIUtilString &GetString() const; 69 void Add(const CMICmnMIValue &vMIValue); 70 71 // Overridden: 72 public: 73 // From CMICmnBase 74 /* dtor */ ~CMICmnMIResultRecord() override; 75 76 // Attributes: 77 private: 78 CMIUtilString 79 m_strResultRecord; // Holds the text version of the result record to date 80 }; 81