27 #include <util/constants.h>
28 #include <ktorrent_export.h>
43 class KTORRENT_EXPORT BNode
57 BNode(Type type,Uint32 off);
61 Type getType()
const {
return type;}
64 Uint32 getOffset()
const {
return off;}
67 Uint32 getLength()
const {
return len;}
70 void setLength(Uint32 l) {len = l;}
73 virtual void printDebugInfo() = 0;
92 const Value & data()
const {
return value;}
93 void printDebugInfo()
override;
101 class KTORRENT_EXPORT BDictNode :
public BNode
108 QList<DictEntry> children;
114 QList<QByteArray> keys()
const;
121 void insert(
const QByteArray & key,
BNode* node);
128 BNode* getData(
const QByteArray & key);
135 BListNode* getList(
const QByteArray& key);
142 BDictNode* getDict(
const QByteArray& key);
152 int getInt(
const QByteArray& key);
155 qint64 getInt64(
const QByteArray& key);
158 QString getString(
const QByteArray& key,QTextCodec* tc);
161 QByteArray getByteArray(
const QByteArray& key);
163 void printDebugInfo()
override;
173 QList<BNode*> children;
182 void append(
BNode* node);
183 void printDebugInfo()
override;
186 Uint32 getNumChildren()
const {
return children.count();}
193 BNode* getChild(Uint32 idx) {
return children.at(idx);}
220 int getInt(Uint32 idx);
223 qint64 getInt64(Uint32 idx);
226 QString getString(Uint32 idx,QTextCodec* tc);
229 QByteArray getByteArray(Uint32 idx);