12#ifndef EXPORT_OBJECTS_MODEL_H
13#define EXPORT_OBJECTS_MODEL_H
20#include <QAbstractTableModel>
21#include <QSortFilterProxyModel>
51 return eo_entry_equal(entry, other.entry);
57 QByteArrayView
Data()
const {
return entry ? QByteArrayView(entry->payload_data, entry->payload_len) : QByteArrayView(); }
62 uint32_t
PacketNum()
const {
return entry ? entry->pkt_num : 0; }
133 bool saveEntry(
const QModelIndex &index, QString filename);
140 void saveEntries(
const QModelIndexList &indices, QString path);
170 static void resetTap(
void *tapdata);
183 QVariant
data(
const QModelIndex &index,
int role)
const override;
192 QVariant
headerData(
int section, Qt::Orientation orientation,
193 int role = Qt::DisplayRole)
const override;
200 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
207 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
211 QList<QVariant> objects_;
214 QSet<ExportObjectEntry> object_set_;
264 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const override;
272 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent)
const override;
276 QString contentFilter_;
A wrapper class for an export object entry.
Definition export_objects_model.h:37
bool operator==(const ExportObjectEntry &other) const
Compares two ExportObjectEntry instances for equality.
Definition export_objects_model.h:50
QByteArrayView Data() const
Retrieves the payload data view for the entry.
Definition export_objects_model.h:57
ExportObjectEntry(export_object_entry_t *entry=nullptr)
Constructs a new ExportObjectEntry.
Definition export_objects_model.h:43
uint32_t PacketNum() const
Retrieves the packet number associated with the entry.
Definition export_objects_model.h:62
A table model managing a list of exportable objects extracted from network traffic.
Definition export_objects_model.h:81
void resetObjects()
Resets and clears all object entries from the model.
Definition export_objects_model.cpp:263
QVariant data(const QModelIndex &index, int role) const override
Retrieves data from the model for a given index and role.
Definition export_objects_model.cpp:66
void addObjectEntry(export_object_entry_t *entry)
Adds a new export object entry to the model.
Definition export_objects_model.cpp:148
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Retrieves the header data for a specific section and role.
Definition export_objects_model.cpp:112
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns under a given parent.
Definition export_objects_model.cpp:143
static void resetTap(void *tapdata)
Static callback used to reset the tap data.
Definition export_objects_model.cpp:281
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under a given parent.
Definition export_objects_model.cpp:133
tap_packet_cb getTapPacketFunc()
Retrieves the callback function used for processing tap packets.
Definition export_objects_model.cpp:299
virtual ~ExportObjectModel()
Destroys the ExportObjectModel.
Definition export_objects_model.cpp:59
ExportObjectModel(register_eo_t *eo, QObject *parent)
Constructs a new ExportObjectModel.
Definition export_objects_model.cpp:48
void saveAllEntries(QString path)
Saves all entries in the model to a directory.
Definition export_objects_model.cpp:222
export_object_entry_t * objectEntry(int row)
Retrieves the export object entry at a specific row.
Definition export_objects_model.cpp:160
void saveEntries(const QModelIndexList &indices, QString path)
Saves multiple entries to a directory.
Definition export_objects_model.cpp:181
ExportObjectColumn
Enumerates the columns for the export object model.
Definition export_objects_model.h:100
@ colFilename
Definition export_objects_model.h:105
@ colHostname
Definition export_objects_model.h:102
@ colExportObjectMax
Definition export_objects_model.h:106
@ colPacket
Definition export_objects_model.h:101
@ colSize
Definition export_objects_model.h:104
@ colContent
Definition export_objects_model.h:103
const char * getTapListenerName()
Retrieves the name of the tap listener.
Definition export_objects_model.cpp:289
void removeTap()
Removes the associated tap listener.
Definition export_objects_model.cpp:304
void * getTapData()
Retrieves the tap data pointer.
Definition export_objects_model.cpp:294
bool saveEntry(const QModelIndex &index, QString filename)
Saves a specific entry to a file.
Definition export_objects_model.cpp:165
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
Determines whether a row from the source model matches the active filters and should be displayed.
Definition export_objects_model.cpp:378
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
Compares two source indices to determine their sort order.
Definition export_objects_model.cpp:318
void setUniqueFilter(bool unique)
Sets the filter to determine whether to show only unique items.
Definition export_objects_model.cpp:365
void setTextFilterString(QString textFilter)
Sets the text filter string used for general searching.
Definition export_objects_model.cpp:352
ExportObjectProxyModel(QObject *parent=Q_NULLPTR)
Constructs a new ExportObjectProxyModel.
Definition export_objects_model.cpp:311
void setContentFilterString(QString contentFilter)
Sets the filter string used for matching content types.
Definition export_objects_model.cpp:339
struct register_eo register_eo_t
Definition export_object.h:61
struct _export_object_list_t export_object_list_t
Abstracts the GUI-specific operations needed to manage a list of exported objects during dissection.
struct _export_object_entry_t export_object_entry_t
Represents a single object extracted from a packet capture for export.
size_t qHash(const ExportObjectEntry &entry, size_t seed=0)
Computes the hash for an ExportObjectEntry.
Definition export_objects_model.cpp:43
GUI context data for the export object list.
Definition export_objects_model.h:28
class ExportObjectModel * model
Pointer to the export object model.
Definition export_objects_model.h:30