Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ProtoNode Class Reference

A wrapper class for the core proto_node structure, providing tree traversal and data access. More...

#include <proto_node.h>

Classes

class  ChildIterator
 An iterator for traversing the child nodes of a ProtoNode. More...
 

Public Member Functions

 ProtoNode (proto_node *node=NULL, ProtoNode *parent=nullptr)
 Constructs a new ProtoNode instance.
 
 ~ProtoNode ()
 Destroys the ProtoNode.
 
bool isValid () const
 Checks if the protocol node is valid.
 
bool isChild () const
 Checks if this node is a child of another node.
 
bool isExpanded () const
 Checks if the node is expanded in the view.
 
proto_nodeprotoNode () const
 Retrieves the underlying core proto_node structure.
 
ProtoNodechild (int row)
 Retrieves a specific child node by its row index.
 
int childrenCount () const
 Retrieves the total number of child nodes.
 
int row ()
 Retrieves the row index of this node relative to its parent.
 
ProtoNodeparentNode ()
 Retrieves the parent node of this node.
 
QString labelText () const
 Retrieves the display label text for this node.
 
ChildIterator children () const
 Retrieves a child iterator for traversing this node's children.
 

Detailed Description

A wrapper class for the core proto_node structure, providing tree traversal and data access.

Constructor & Destructor Documentation

◆ ProtoNode()

ProtoNode::ProtoNode ( proto_node node = NULL,
ProtoNode parent = nullptr 
)
explicit

Constructs a new ProtoNode instance.

Parameters
nodeThe underlying core proto_node, defaults to NULL.
parentThe parent ProtoNode, defaults to nullptr.

Member Function Documentation

◆ child()

ProtoNode * ProtoNode::child ( int  row)

Retrieves a specific child node by its row index.

Parameters
rowThe index of the child node to retrieve.
Returns
A pointer to the child ProtoNode.

◆ children()

ProtoNode::ChildIterator ProtoNode::children ( ) const

Retrieves a child iterator for traversing this node's children.

Returns
A ChildIterator positioned at the first child.

◆ childrenCount()

int ProtoNode::childrenCount ( ) const

Retrieves the total number of child nodes.

Returns
The child count.

◆ isChild()

bool ProtoNode::isChild ( ) const

Checks if this node is a child of another node.

Returns
True if it is a child node, false otherwise.

◆ isExpanded()

bool ProtoNode::isExpanded ( ) const

Checks if the node is expanded in the view.

Returns
True if expanded, false otherwise.

◆ isValid()

bool ProtoNode::isValid ( ) const

Checks if the protocol node is valid.

Returns
True if the underlying node is valid, false otherwise.

◆ labelText()

QString ProtoNode::labelText ( ) const

Retrieves the display label text for this node.

Returns
The label text string.

◆ parentNode()

ProtoNode * ProtoNode::parentNode ( )

Retrieves the parent node of this node.

Returns
A pointer to the parent ProtoNode.

◆ protoNode()

proto_node * ProtoNode::protoNode ( ) const

Retrieves the underlying core proto_node structure.

Returns
A pointer to the proto_node.

◆ row()

int ProtoNode::row ( )

Retrieves the row index of this node relative to its parent.

Returns
The row index.

The documentation for this class was generated from the following files: