2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Renamed member variables.
	* src/FileEntry.cc
	* src/FileEntry.h
pull/1/head
Tatsuhiro Tsujikawa 2010-06-12 09:23:19 +00:00
parent 0bdd20e6fc
commit 3ff5218872
3 changed files with 33 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed member variables.
* src/FileEntry.cc
* src/FileEntry.h
2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed member variables.

View File

@ -48,13 +48,14 @@ FileEntry::FileEntry(const std::string& path,
uint64_t length,
off_t offset,
const std::vector<std::string>& uris):
path(path), _uris(uris.begin(), uris.end()), length(length), offset(offset),
requested(true),
_path(path), _uris(uris.begin(), uris.end()), _length(length),
_offset(offset),
_requested(true),
_singleHostMultiConnection(true),
_logger(LogFactory::getInstance()) {}
FileEntry::FileEntry():
length(0), offset(0), requested(false),
_length(0), _offset(0), _requested(false),
_singleHostMultiConnection(true),
_logger(LogFactory::getInstance()) {}
@ -62,23 +63,23 @@ FileEntry::~FileEntry() {}
void FileEntry::setupDir()
{
util::mkdirs(File(path).getDirname());
util::mkdirs(File(_path).getDirname());
}
FileEntry& FileEntry::operator=(const FileEntry& entry)
{
if(this != &entry) {
path = entry.path;
length = entry.length;
offset = entry.offset;
requested = entry.requested;
_path = entry._path;
_length = entry._length;
_offset = entry._offset;
_requested = entry._requested;
}
return *this;
}
bool FileEntry::operator<(const FileEntry& fileEntry) const
{
return offset < fileEntry.offset;
return _offset < fileEntry._offset;
}
bool FileEntry::exists() const
@ -88,8 +89,8 @@ bool FileEntry::exists() const
off_t FileEntry::gtoloff(off_t goff) const
{
assert(offset <= goff);
return goff-offset;
assert(_offset <= goff);
return goff-_offset;
}
void FileEntry::getUris(std::vector<std::string>& uris) const

View File

@ -57,12 +57,12 @@ class Logger;
class FileEntry {
private:
std::string path;
std::string _path;
std::deque<std::string> _uris;
std::deque<std::string> _spentUris;
uint64_t length;
off_t offset;
bool requested;
uint64_t _length;
off_t _offset;
bool _requested;
std::deque<SharedHandle<Request> > _requestPool;
std::deque<SharedHandle<Request> > _inFlightRequests;
std::string _contentType;
@ -86,31 +86,31 @@ public:
std::string getBasename() const
{
return File(path).getBasename();
return File(_path).getBasename();
}
std::string getDirname() const
{
return File(path).getDirname();
return File(_path).getDirname();
}
const std::string& getPath() const { return path; }
const std::string& getPath() const { return _path; }
void setPath(const std::string& path) { this->path = path; }
void setPath(const std::string& path) { _path = path; }
uint64_t getLength() const { return length; }
uint64_t getLength() const { return _length; }
void setLength(uint64_t length) { this->length = length; }
void setLength(uint64_t length) { _length = length; }
off_t getOffset() const { return offset; }
off_t getOffset() const { return _offset; }
void setOffset(off_t offset) { this->offset = offset; }
void setOffset(off_t offset) { _offset = offset; }
off_t getLastOffset() { return offset+length; }
off_t getLastOffset() { return _offset+_length; }
bool isRequested() const { return requested; }
bool isRequested() const { return _requested; }
void setRequested(bool flag) { this->requested = flag; }
void setRequested(bool flag) { _requested = flag; }
void setupDir();