Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
proto_node.h
Go to the documentation of this file.
1
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
105 ProtoNode *child(int row);
106
111 int childrenCount() const;
112
117 int row();
118
124
129 QString labelText() const;
130
135 ChildIterator children() const;
136
137private:
139 proto_node * node_;
140
142 QVector<ProtoNode*>m_children;
143
145 ProtoNode *parent_;
146
152 static bool isHidden(proto_node * node);
153};
154
155
156#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:160
NodePtr node
Definition proto_node.h:61
bool hasNext()
Checks if there is a subsequent child node.
Definition proto_node.cpp:145
ChildIterator next()
Advances the iterator to the next child node.
Definition proto_node.cpp:152
struct _proto_node * NodePtr
Pointer type for the underlying proto_node structure.
Definition proto_node.h:33
A wrapper class for the core proto_node structure, providing tree traversal and data access.
Definition proto_node.h:24
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:128
int row()
Retrieves the row index of this node relative to its parent.
Definition proto_node.cpp:99
proto_node * protoNode() const
Retrieves the underlying core proto_node structure.
Definition proto_node.cpp:116
~ProtoNode()
Destroys the ProtoNode.
Definition proto_node.cpp:39
int childrenCount() const
Retrieves the total number of child nodes.
Definition proto_node.cpp:92
bool isChild() const
Checks if this node is a child of another node.
Definition proto_node.cpp:49
QString labelText() const
Retrieves the display label text for this node.
Definition proto_node.cpp:59
bool isExpanded() const
Checks if the node is expanded in the view.
Definition proto_node.cpp:108
ProtoNode * parentNode()
Retrieves the parent node of this node.
Definition proto_node.cpp:54
ProtoNode * child(int row)
Retrieves a specific child node by its row index.
Definition proto_node.cpp:121
Definition proto.h:909