/* */ #ifndef _D_FILE_ENTRY_H_ #define _D_FILE_ENTRY_H_ #include "common.h" #include "File.h" class FileEntry { private: string path; int64_t length; int64_t offset; bool extracted; bool requested; public: FileEntry():length(0), offset(0), extracted(false), requested(false) {} FileEntry(const string& path, long long int length, long long int offset); FileEntry& operator=(const FileEntry& entry) { if(this != &entry) { path = entry.path; length = entry.length; offset = entry.offset; extracted = entry.extracted; requested = entry.requested; } return *this; } ~FileEntry(); string getBasename() const { return File(path).getBasename(); } string getDirname() const { return File(path).getDirname(); } const string& getPath() const { return path; } void setPath(const string& path) { this->path = path; } int64_t getLength() const { return length; } void setLength(long long int length) { this->length = length; } long long int getOffset() const { return offset; } void setOffset(long long int offset) { this->offset = offset; } bool isExtracted() const { return extracted; } void setExtracted(bool flag) { this->extracted = flag; } bool isRequested() const { return requested; } void setRequested(bool flag) { this->requested = flag; } void setupDir(const string& parentDir); }; typedef SharedHandle FileEntryHandle; typedef deque FileEntries; #endif // _D_FILE_ENTRY_H_