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

Decodes b-encoded data. More...

#include <bdecoder.h>

Public Member Functions

 BDecoder (const QByteArray &data, bool verbose, Uint32 off=0)
 
 BDecoder (const Uint8 *ptr, Uint32 size, bool verbose, Uint32 off=0)
 
BNodedecode ()
 
BDictNodedecodeDict ()
 
BListNodedecodeList ()
 
Uint32 position () const
 Get the current position in the data.
 

Detailed Description

Author
Joris Guisson Class to decode b-encoded data.

Definition at line 59 of file bdecoder.h.

Constructor & Destructor Documentation

◆ BDecoder() [1/2]

bt::BDecoder::BDecoder ( const Uint8 *  ptr,
Uint32  size,
bool  verbose,
Uint32  off = 0 
)

Constructor, passes in the data to decode.

Parameters
ptrPointer to the data
sizeSize of the data
verboseVerbose output to the log
offOffset to start parsing

◆ BDecoder() [2/2]

bt::BDecoder::BDecoder ( const QByteArray &  data,
bool  verbose,
Uint32  off = 0 
)

Constructor, passes in the data to decode.

Parameters
dataThe data
verboseVerbose output to the log
offOffset to start parsing

Member Function Documentation

◆ decode()

BNode* bt::BDecoder::decode ( )

Decode the data, the root node gets returned. (Note that the caller must delete this node)

Returns
The root node

◆ decodeDict()

BDictNode* bt::BDecoder::decodeDict ( )

Decode the data, the root dict node gets returned. (Note that the caller must delete this node)

Returns
The root node

◆ decodeList()

BListNode* bt::BDecoder::decodeList ( )

Decode the data, the root list node gets returned. (Note that the caller must delete this node)

Returns
The root node

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