26 #include <util/constants.h>
27 #include <ktorrent_export.h>
42 class KTORRENT_EXPORT BNode
56 BNode(Type type,Uint32 off);
60 Type getType()
const {
return type;}
63 Uint32 getOffset()
const {
return off;}
66 Uint32 getLength()
const {
return len;}
69 void setLength(Uint32 l) {len = l;}
72 virtual void printDebugInfo() = 0;
91 const Value & data()
const {
return value;}
92 void printDebugInfo()
override;
100 class KTORRENT_EXPORT BDictNode :
public BNode
107 QList<DictEntry> children;
113 QList<QByteArray> keys()
const;
120 void insert(
const QByteArray & key,
BNode* node);
127 BNode* getData(
const QByteArray & key);
134 BListNode* getList(
const QByteArray& key);
141 BDictNode* getDict(
const QByteArray& key);
151 int getInt(
const QByteArray& key);
154 qint64 getInt64(
const QByteArray& key);
157 QString getString(
const QByteArray& key,QTextCodec* tc);
160 QByteArray getByteArray(
const QByteArray& key);
162 void printDebugInfo()
override;
172 QList<BNode*> children;
181 void append(
BNode* node);
182 void printDebugInfo()
override;
185 Uint32 getNumChildren()
const {
return children.count();}
192 BNode* getChild(Uint32 idx) {
return children.at(idx);}
219 int getInt(Uint32 idx);
222 qint64 getInt64(Uint32 idx);
225 QString getString(Uint32 idx,QTextCodec* tc);
228 QByteArray getByteArray(Uint32 idx);