143 lines
2.9 KiB
C++
143 lines
2.9 KiB
C++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <QStringList>
|
|
#include <QVector>
|
|
#include "logger.h"
|
|
|
|
namespace N_LogView
|
|
{
|
|
class LogViewXdrElement;
|
|
class LogViewField
|
|
{
|
|
public:
|
|
enum E_FieldKind
|
|
{
|
|
e_FieldKindBorder,
|
|
e_FieldKindEdit,
|
|
e_FieldKindTab,
|
|
e_FieldKindTabChild,
|
|
e_FieldKindPodArray,
|
|
e_FieldKindPodArrayChild
|
|
};
|
|
|
|
|
|
LogViewField(const QString& a_name, const E_FieldKind a_kind, const LogViewXdrElement* a_xdrElement);
|
|
virtual ~LogViewField();
|
|
|
|
LogViewField *clone(int arrayIdx) const;
|
|
|
|
QString cleanName() const { return makeClean(m_Name); }
|
|
QString name() const { return m_Name; }
|
|
void setName(const QString &newVal) { m_Name = newVal; }
|
|
|
|
|
|
void addChild(LogViewField* a_child);
|
|
void removeLastChild();
|
|
LogViewField *child(int arrayIdx);
|
|
int childCount() const { return m_Child.size(); }
|
|
|
|
QString type() const { return m_type; }
|
|
void setType(const QString &type) { m_type = type; }
|
|
|
|
LogViewField::E_FieldKind kind() const { return m_Kind; }
|
|
|
|
void addValue(const QString &value);
|
|
void addValueBinaryHex(const QString &value);
|
|
|
|
|
|
|
|
QString value(int arrayIdx, const bool a_doNotMakeSpecialConversions = false) const;
|
|
int valueListSize() const { return m_ValueList.size(); }
|
|
|
|
|
|
bool isRightAligned() const { return m_IsRightAligned; }
|
|
void setIsRightAligned(bool newVal) { m_IsRightAligned = newVal; }
|
|
|
|
|
|
QString toolTipText() const { return m_ToolTipText; }
|
|
void setToolTipText(const QString &newVal) { m_ToolTipText = newVal; }
|
|
|
|
|
|
int64_t getHighestValue() const;
|
|
int64_t getLowestValue() const;
|
|
|
|
|
|
|
|
void dump(const QString &a_indent = QString()) const;
|
|
|
|
|
|
|
|
static QString makeClean(const QString &text);
|
|
|
|
|
|
int size() const { return m_Size; }
|
|
void setSize(int newVal) { m_Size = newVal; }
|
|
|
|
|
|
const LogViewXdrElement* xdrElement() const { return m_XdrElement; }
|
|
|
|
|
|
|
|
bool isDateTimeField() const;
|
|
bool isMSecsField() const;
|
|
|
|
|
|
uint16_t maxArraySize() const { return m_MaxArraySize; }
|
|
void setMaxArraySize(uint16_t newVal, const bool a_isDynamic);
|
|
|
|
|
|
|
|
bool isDynamicArray() const { return m_IsDynamicArray; }
|
|
|
|
|
|
bool hasContent() const { return m_HasContent; }
|
|
void setHasContent(bool newVal) { m_HasContent = newVal; }
|
|
|
|
void setDeleteXdr(bool bDelete) { m_bDeleteXdr = bDelete; }
|
|
|
|
void setJsonPath(const QStringList &path) { m_jsonPath = path; }
|
|
QStringList jsonPath() const { return m_jsonPath; }
|
|
|
|
protected:
|
|
|
|
QString m_Name;
|
|
QString m_type;
|
|
QStringList m_ValueList;
|
|
QStringList m_jsonPath;
|
|
bool m_IsRightAligned;
|
|
QString m_ToolTipText;
|
|
uint16_t m_Offset;
|
|
int m_Size;
|
|
uint16_t m_MaxArraySize;
|
|
|
|
|
|
bool m_IsDynamicArray;
|
|
bool m_HasContent;
|
|
bool m_bDeleteXdr;
|
|
QVector<LogViewField*> m_Child;
|
|
|
|
E_FieldKind m_Kind;
|
|
|
|
const LogViewXdrElement *m_XdrElement;
|
|
|
|
private:
|
|
|
|
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
}
|