23 #include <ktorrent_export.h>
24 #include <util/constants.h>
25 #include <diskio/piecedata.h>
45 class KTORRENT_EXPORT Chunk
48 Chunk(Uint32 index,Uint32 size,Cache* cache);
63 bool readPiece(Uint32 off,Uint32 len,Uint8* data);
73 PieceData::Ptr getPiece(Uint32 off,Uint32 len,
bool read_only);
80 void savePiece(PieceData::Ptr piece);
83 Status getStatus()
const {
return status;}
89 void setStatus(Status s) {status = s;}
92 Uint32 getIndex()
const {
return index;}
95 Uint32 getSize()
const {
return size;}
98 Priority getPriority()
const {
return priority;}
101 void setPriority(Priority newpriority = NORMAL_PRIORITY) {priority = newpriority;}
104 bool isExcluded()
const {
return priority == EXCLUDED;}
107 bool isExcludedForDownloading()
const {
return priority == ONLY_SEED_PRIORITY;}
110 void setExclude(
bool yes) {priority = yes ? EXCLUDED : NORMAL_PRIORITY;}