Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
proto_node.h
Go to the documentation of this file.
1
9
10#ifndef PROTO_NODE_H_
11#define PROTO_NODE_H_
12
13#include <config.h>
14
15#include <epan/proto.h>
16
17#include <QObject>
18#include <QVector>
19
24{
25public:
26
31 public:
33 typedef struct _proto_node * NodePtr;
34
39 ChildIterator(NodePtr n = Q_NULLPTR);
40
45 bool hasNext();
46
52
58
59 protected:
62 };
63
69 explicit ProtoNode(proto_node * node = NULL, ProtoNode *parent = nullptr);
70
74 ~ProtoNode();
75
80 bool isValid() const;
81
86 bool isChild() const;
87
92 bool isExpanded() const;
93
98 proto_node *protoNode() const;
99
104 field_info *fieldInfo() const;
105
110 int hfId() const;
111
117 ProtoNode *child(int row) const;
118
123 int childrenCount() const;
124
129 int row() const;
130
135 ProtoNode *parentNode() const;
136
141 QString labelText() const;
142
147 ChildIterator children() const;
148
149private:
151 proto_node * node_;
152
154 QVector<ProtoNode*>m_children;
155
157 ProtoNode *parent_;
158
164 static bool isHidden(proto_node * node);
165};
166
167
168#endif // PROTO_NODE_H_
An iterator for traversing the child nodes of a ProtoNode.
Definition proto_node.h:30
ProtoNode element()
Retrieves the ProtoNode element at the current iterator position.
Definition proto_node.cpp:168
NodePtr node
Definition proto_node.h:61
bool hasNext()
Checks if there is a subsequent child node.
Definition proto_node.cpp:153
ChildIterator next()
Advances the iterator to the next child node.
Definition proto_node.cpp:160
struct _proto_node * NodePtr
Pointer type for the underlying proto_node structure.
Definition proto_node.h:33
ChildIterator(NodePtr n=Q_NULLPTR)
Constructs a new ChildIterator.
Definition proto_node.cpp:148
ProtoNode * parentNode() const
Retrieves the parent node of this node.
Definition proto_node.cpp:54
int hfId() const
Retrieves the header field id of the underlying node.
Definition proto_node.cpp:123
bool isValid() const
Checks if the protocol node is valid.
Definition proto_node.cpp:44
ChildIterator children() const
Retrieves a child iterator for traversing this node's children.
Definition proto_node.cpp:136
proto_node * protoNode() const
Retrieves the underlying core proto_node structure.
Definition proto_node.cpp:113
~ProtoNode()
Destroys the ProtoNode.
Definition proto_node.cpp:39
int childrenCount() const
Retrieves the total number of child nodes.
Definition proto_node.cpp:89
int row() const
Retrieves the row index of this node relative to its parent.
Definition proto_node.cpp:96
bool isChild() const
Checks if this node is a child of another node.
Definition proto_node.cpp:49
field_info * fieldInfo() const
Retrieves the field information of the underlying node.
Definition proto_node.cpp:118
QString labelText() const
Retrieves the display label text for this node.
Definition proto_node.cpp:59
ProtoNode(proto_node *node=NULL, ProtoNode *parent=nullptr)
Constructs a new ProtoNode instance.
Definition proto_node.cpp:16
ProtoNode * child(int row) const
Retrieves a specific child node by its row index.
Definition proto_node.cpp:129
bool isExpanded() const
Checks if the node is expanded in the view.
Definition proto_node.cpp:105
struct _proto_node proto_node
Definition proto.h:939
Definition proto.h:847