/* */ #ifndef _D_FILE_ENTRY_H_ #define _D_FILE_ENTRY_H_ #include "common.h" #include "File.h" class FileEntry { private: string path; Strings _uris; int64_t length; int64_t offset; bool extracted; bool requested; public: FileEntry():length(0), offset(0), extracted(false), requested(false) {} FileEntry(const string& path, int64_t length, int64_t offset, const Strings& uris = Strings()); ~FileEntry(); FileEntry& operator=(const FileEntry& entry); 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(int64_t length) { this->length = length; } int64_t getOffset() const { return offset; } void setOffset(int64_t 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); const Strings& getAssociatedUris() const { return _uris; } bool operator<(const FileEntry& fileEntry) const; }; typedef SharedHandle FileEntryHandle; typedef deque FileEntries; #endif // _D_FILE_ENTRY_H_