libktorrent  2.1.1
Public Member Functions | List of all members
bt::BListNode Class Reference

Represents a list in bencoded data. More...

#include <bnode.h>

Inheritance diagram for bt::BListNode:
Inheritance graph
[legend]

Public Member Functions

 BListNode (Uint32 off)
 
void append (BNode *node)
 
QByteArray getByteArray (Uint32 idx)
 Same as getValue, except directly returns an QByteArray, if something goes wrong, an error will be thrown.
 
BNodegetChild (Uint32 idx)
 
BDictNodegetDict (Uint32 idx)
 
int getInt (Uint32 idx)
 Same as getValue, except directly returns an int, if something goes wrong, an error will be thrown.
 
qint64 getInt64 (Uint32 idx)
 Same as getValue, except directly returns a qint64, if something goes wrong, an error will be thrown.
 
BListNodegetList (Uint32 idx)
 
Uint32 getNumChildren () const
 Get the number of nodes in the list.
 
QString getString (Uint32 idx, QTextCodec *tc)
 Same as getValue, except directly returns a QString, if something goes wrong, an error will be thrown.
 
BValueNodegetValue (Uint32 idx)
 
void printDebugInfo () override
 Print some debugging info.
 
- Public Member Functions inherited from bt::BNode
 BNode (Type type, Uint32 off)
 
Uint32 getLength () const
 Get the length this node takes up in the bytearray.
 
Uint32 getOffset () const
 Get the offset in the bytearray where this node starts.
 
Type getType () const
 Get the type of node.
 
void setLength (Uint32 l)
 Set the length.
 

Additional Inherited Members

- Public Types inherited from bt::BNode
enum  Type { VALUE, DICT, LIST }
 

Detailed Description

Author
Joris Guisson

Definition at line 189 of file bnode.h.

Member Function Documentation

◆ append()

void bt::BListNode::append ( BNode node)

Append a node to the list.

Parameters
nodeThe node

◆ getChild()

BNode* bt::BListNode::getChild ( Uint32  idx)
inline

Get a node from the list

Parameters
idxThe index
Returns
The node or 0 if idx is out of bounds

Definition at line 211 of file bnode.h.

◆ getDict()

BDictNode* bt::BListNode::getDict ( Uint32  idx)

Get a BDictNode.

Parameters
idxThe index
Returns
The node or 0 if the index is out of bounds or the element at postion idx isn't a BDictNode.

◆ getList()

BListNode* bt::BListNode::getList ( Uint32  idx)

Get a BListNode.

Parameters
idxThe index
Returns
The node or 0 if the index is out of bounds or the element at postion idx isn't a BListNode.

◆ getValue()

BValueNode* bt::BListNode::getValue ( Uint32  idx)

Get a BValueNode.

Parameters
idxThe index
Returns
The node or 0 if the index is out of bounds or the element at postion idx isn't a BValueNode.

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