libktorrent  2.2.0
Classes | Public Member Functions | List of all members
bt::BDictNode Class Reference

Represents a dictionary in bencoded data. More...

#include <bnode.h>

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

Public Member Functions

 BDictNode (Uint32 off)
 
QByteArray getByteArray (const QByteArray &key)
 Same as getValue, except directly returns an QByteArray, if something goes wrong, an error will be thrown.
 
BNodegetData (const QByteArray &key)
 
BDictNodegetDict (const QByteArray &key)
 
int getInt (const QByteArray &key)
 Same as getValue, except directly returns an int, if something goes wrong, an error will be thrown.
 
qint64 getInt64 (const QByteArray &key)
 Same as getValue, except directly returns a qint64, if something goes wrong, an error will be thrown.
 
BListNodegetList (const QByteArray &key)
 
QString getString (const QByteArray &key, QTextCodec *tc)
 Same as getValue, except directly returns a QString, if something goes wrong, an error will be thrown.
 
BValueNodegetValue (const QByteArray &key)
 
void insert (const QByteArray &key, BNode *node)
 
QList< QByteArray > keys () const
 Get a list of keys.
 
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 118 of file bnode.h.

Member Function Documentation

◆ getData()

BNode* bt::BDictNode::getData ( const QByteArray &  key)

Get a BNode.

Parameters
keyThe key
Returns
The node or 0 if there is no node with has key key

◆ getDict()

BDictNode* bt::BDictNode::getDict ( const QByteArray &  key)

Get a BDictNode.

Parameters
keyThe key
Returns
The node or 0 if there is no dict node with has key key

◆ getList()

BListNode* bt::BDictNode::getList ( const QByteArray &  key)

Get a BListNode.

Parameters
keyThe key
Returns
The node or 0 if there is no list node with has key key

◆ getValue()

BValueNode* bt::BDictNode::getValue ( const QByteArray &  key)

Get a BValueNode.

Parameters
keyThe key
Returns
The node or 0 if there is no value node with has key key

◆ insert()

void bt::BDictNode::insert ( const QByteArray &  key,
BNode node 
)

Insert a BNode in the dictionary.

Parameters
keyThe key
nodeThe node

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