#pragma once
#include "lldb/API/SBValue.h"
#include "MICmnMIValueTuple.h"
#include "MIDataTypes.h"
class CMIUtilString;
class CMICmnLLDBUtilSBValue {
public:
CMICmnLLDBUtilSBValue(const lldb::SBValue &vrValue,
const bool vbHandleCharType = false,
const bool vbHandleArrayType = true);
~CMICmnLLDBUtilSBValue();
CMIUtilString GetName() const;
CMIUtilString GetValue(const bool vbExpandAggregates = false) const;
CMIUtilString GetTypeName() const;
CMIUtilString GetTypeNameDisplay() const;
bool IsCharType() const;
bool IsFirstChildCharType() const;
bool IsPointeeCharType() const;
bool IsIntegerType() const;
bool IsPointerType() const;
bool IsArrayType() const;
bool IsLLDBVariable() const;
bool IsNameUnknown() const;
bool IsValueUnknown() const;
bool IsValid() const;
bool HasName() const;
private:
template <typename charT>
CMIUtilString
ReadCStringFromHostMemory(lldb::SBValue &vrValue,
const MIuint vnMaxLen = UINT32_MAX) const;
bool GetSimpleValue(const bool vbHandleArrayType,
CMIUtilString &vrValue) const;
bool GetCompositeValue(const bool vbPrintFieldNames,
CMICmnMIValueTuple &vwrMiValueTuple,
const MIuint vnDepth = 1) const;
CMIUtilString
GetValueSummary(bool valueOnly,
const CMIUtilString &failVal = CMIUtilString()) const;
private:
static bool IsCharBasicType(lldb::BasicType eType);
private:
lldb::SBValue &m_rValue;
bool m_bValidSBValue;
bool m_bHandleCharType;
bool m_bHandleArrayType;
};