aria2/src/FileEntry.h

43 lines
1.3 KiB
C
Raw Normal View History

2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes): Renamed as onSelectiveDownloadingCompletes. (onSelectiveDownloadingCompletes): Updated message. To add DiskAdaptor which abstract DiskWriter family: * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter. * src/BitfieldMan.cc (isAllBitSet): bug fix. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h, MultiDiskAdaptor.h. (readFileEntry): Changed its arguments. (setup): setupDiskWriter is merged into this function. (setupDiskWriter): Removed. (setFileFilter): New function. (readFileEntryFromMetaInfoFile): Updated according to the changes made in readFileEntry. (getFilePath): Removed. (getTempFilePath): Removed. (getSegmentFilePath): Updated due to the removal of getFilePath. (fixFilename): Removed. (copySingleFile): Removed. (splitMultiFile): Removed. (deleteTempFile): Removed. (setFileEntriesToDownload): Removed. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode. (isSelectiveDownloadingMode): New function. (setAllMultiFileRequestedState): Removed. (finishPartialDownloadingMode): Renamed as finishSelectiveDownloadingMode. (finishSelectiveDownloadingMode): New function. (getPartialTotalLength): Renamed as getSelectedTotalLength. (getSelectedTotalLength): New function. (onDownloadComplete): Use diskAdaptor. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength (Range): Removed. (setMultiFileEntries): Renamed as setFileEntries. (setFileEntries): New function. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed. (pieceLength): New variable. * src/main.cc (printDownloadCompeleteMessage): New function. (torrentHandler): Use diskAdaptor instead of diskWriter. (main): Renamed torrent-show-files to show-files. Rewritten file contents listing. * src/TorrentMan.h (FileEntry): Removed. (multiFileTopDir): Removed. (multiFileEntries): Removed. (diskWriter): Removed. (diskAdaptor): New variable. * src/DefaultDiskWriter.h (totalLength): New variable. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of diskWriter. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff. (partialTotalLength): Renamed as selectedTotalLength. * src/AbstractDiskWriter.cc (openFile): If file exists, call openExistingFile, otherwise call initAndOpenFile. (closeFile): fd > 0, not fd != 0. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES (PREF_SHOW_FILES): New definition.
2006-04-16 14:38:19 +00:00
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_FILE_ENTRY_H_
#define _D_FILE_ENTRY_H_
#include "common.h"
class FileEntry {
public:
string path;
long long int length;
long long int offset;
bool extracted;
bool requested;
FileEntry(const string& path, long long int length, long long int offset):
2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes): Renamed as onSelectiveDownloadingCompletes. (onSelectiveDownloadingCompletes): Updated message. To add DiskAdaptor which abstract DiskWriter family: * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter. * src/BitfieldMan.cc (isAllBitSet): bug fix. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h, MultiDiskAdaptor.h. (readFileEntry): Changed its arguments. (setup): setupDiskWriter is merged into this function. (setupDiskWriter): Removed. (setFileFilter): New function. (readFileEntryFromMetaInfoFile): Updated according to the changes made in readFileEntry. (getFilePath): Removed. (getTempFilePath): Removed. (getSegmentFilePath): Updated due to the removal of getFilePath. (fixFilename): Removed. (copySingleFile): Removed. (splitMultiFile): Removed. (deleteTempFile): Removed. (setFileEntriesToDownload): Removed. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode. (isSelectiveDownloadingMode): New function. (setAllMultiFileRequestedState): Removed. (finishPartialDownloadingMode): Renamed as finishSelectiveDownloadingMode. (finishSelectiveDownloadingMode): New function. (getPartialTotalLength): Renamed as getSelectedTotalLength. (getSelectedTotalLength): New function. (onDownloadComplete): Use diskAdaptor. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength (Range): Removed. (setMultiFileEntries): Renamed as setFileEntries. (setFileEntries): New function. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed. (pieceLength): New variable. * src/main.cc (printDownloadCompeleteMessage): New function. (torrentHandler): Use diskAdaptor instead of diskWriter. (main): Renamed torrent-show-files to show-files. Rewritten file contents listing. * src/TorrentMan.h (FileEntry): Removed. (multiFileTopDir): Removed. (multiFileEntries): Removed. (diskWriter): Removed. (diskAdaptor): New variable. * src/DefaultDiskWriter.h (totalLength): New variable. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of diskWriter. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff. (partialTotalLength): Renamed as selectedTotalLength. * src/AbstractDiskWriter.cc (openFile): If file exists, call openExistingFile, otherwise call initAndOpenFile. (closeFile): fd > 0, not fd != 0. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES (PREF_SHOW_FILES): New definition.
2006-04-16 14:38:19 +00:00
path(path), length(length), offset(offset),
extracted(false), requested(true) {}
~FileEntry() {}
};
typedef deque<FileEntry> FileEntries;
#endif // _D_FILE_ENTRY_H_