diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 12:30:11 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 12:30:11 +0000 |
| commit | c342bde9627b434effbc0cd10b817670d1da0923 (patch) | |
| tree | 60d14bf448066b8dcd639adfa0db716d5a8258c8 /src/FileEntry.h | |
| parent | 135f0a2a8c4ee04a5e96d84ba558245fabfc1f5c (diff) | |
2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for containers which is used for
mostly read-only purpose.
Diffstat (limited to 'src/FileEntry.h')
| -rw-r--r-- | src/FileEntry.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/FileEntry.h b/src/FileEntry.h index 0199ba28..2faa8bfa 100644 --- a/src/FileEntry.h +++ b/src/FileEntry.h @@ -39,6 +39,7 @@ #include <string> #include <deque> +#include <vector> #include <ostream> #include "SharedHandle.h" @@ -78,7 +79,7 @@ public: FileEntry(); FileEntry(const std::string& path, uint64_t length, off_t offset, - const std::deque<std::string>& uris = std::deque<std::string>()); + const std::vector<std::string>& uris = std::vector<std::string>()); ~FileEntry(); @@ -133,9 +134,9 @@ public: return _spentUris; } - void setUris(const std::deque<std::string>& uris) + void setUris(const std::vector<std::string>& uris) { - _uris = uris; + _uris = std::deque<std::string>(uris.begin(), uris.end()); } template<typename InputIterator> @@ -145,7 +146,7 @@ public: } // Inserts _uris and _spentUris into uris. - void getUris(std::deque<std::string>& uris) const; + void getUris(std::vector<std::string>& uris) const; void setContentType(const std::string& contentType) { @@ -240,9 +241,6 @@ public: } }; -typedef SharedHandle<FileEntry> FileEntryHandle; -typedef std::deque<FileEntryHandle> FileEntries; - // Returns the first FileEntry which isRequested() method returns // true. If no such FileEntry exists, then returns // SharedHandle<FileEntry>(). @@ -298,7 +296,7 @@ void writeFilePath o << "n/a"; } else { if(e->getPath().empty()) { - std::deque<std::string> uris; + std::vector<std::string> uris; e->getUris(uris); if(uris.empty()) { o << "n/a"; |
