1 //===-- SWIG Interface for SBStructuredData ---------------------*- 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 namespace lldb { 10 11 %feature("docstring", 12 "A class representing a StructuredData event. 13 14 This class wraps the event type generated by StructuredData features." 15 ) SBStructuredData; 16 class SBStructuredData 17 { 18 public: 19 SBStructuredData(); 20 21 SBStructuredData(const lldb::SBStructuredData &rhs); 22 23 SBStructuredData(const lldb::EventSP &event_sp); 24 25 ~SBStructuredData(); 26 27 bool 28 IsValid() const; 29 30 explicit operator bool() const; 31 32 void 33 Clear(); 34 35 lldb::StructuredDataType GetType() const; 36 37 size_t GetSize() const; 38 39 bool GetKeys(lldb::SBStringList &keys) const; 40 41 lldb::SBStructuredData GetValueForKey(const char *key) const; 42 43 lldb::SBStructuredData GetItemAtIndex(size_t idx) const; 44 45 uint64_t GetIntegerValue(uint64_t fail_value = 0) const; 46 47 double GetFloatValue(double fail_value = 0.0) const; 48 49 bool GetBooleanValue(bool fail_value = false) const; 50 51 size_t GetStringValue(char *dst, size_t dst_len) const; 52 53 lldb::SBError 54 GetAsJSON(lldb::SBStream &stream) const; 55 56 lldb::SBError 57 GetDescription(lldb::SBStream &stream) const; 58 59 lldb::SBError 60 SetFromJSON(lldb::SBStream &stream); 61 62 lldb::SBError 63 SetFromJSON(const char *json); 64 }; 65 } 66