~ubuntu-branches/ubuntu/wily/aria2/wily-proposed

« back to all changes in this revision

Viewing changes to src/download_helper.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Patrick Ruckstuhl
  • Date: 2013-09-22 18:52:14 UTC
  • mfrom: (2.5.19 sid)
  • Revision ID: package-import@ubuntu.com-20130922185214-upeu2ljgeqi7e7oo
Tags: 1.18.0-1
[ Kartik Mistry ]
* New upstream release.
* debian/control:
  + (really) Set priority to optional from extra (Closes: #697659).
  + wrap-and-sort some fields.

[ Patrick Ruckstuhl ]
* debian/rules:
  + Allow parallel building (Closes: #720977)
* debian/tests, debian/control:
  + autopkgtest infrastructure

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include <string>
41
41
#include <vector>
42
42
#include <set>
43
 
 
44
 
#include "SharedHandle.h"
 
43
#include <memory>
45
44
 
46
45
namespace aria2 {
47
46
 
61
60
// adjusted using bittorrent::adjustAnnounceUri().  In this function,
62
61
// force-sequential is ignored.
63
62
void createRequestGroupForBitTorrent
64
 
(std::vector<SharedHandle<RequestGroup> >& result,
65
 
 const SharedHandle<Option>& option,
 
63
(std::vector<std::shared_ptr<RequestGroup>>& result,
 
64
 const std::shared_ptr<Option>& option,
66
65
 const std::vector<std::string>& uris,
67
66
 const std::string& metaInfoUri,
68
67
 const std::string& torrentData = "",
73
72
// adjusted using bittorrent::adjustAnnounceUri().  In this function,
74
73
// force-sequential is ignored.
75
74
void createRequestGroupForBitTorrent
76
 
(std::vector<SharedHandle<RequestGroup> >& result,
77
 
 const SharedHandle<Option>& option,
 
75
(std::vector<std::shared_ptr<RequestGroup>>& result,
 
76
 const std::shared_ptr<Option>& option,
78
77
 const std::vector<std::string>& uris,
79
78
 const std::string& metaInfoUri,
80
 
 const SharedHandle<ValueBase>& torrent,
 
79
 const ValueBase* torrent,
81
80
 bool adjustAnnounceUri = true);
82
81
 
83
82
#endif // ENABLE_BITTORRENT
87
86
// metalink-file option. If non-empty metalinkData is specified, it is
88
87
// used as a content of metalink file instead.
89
88
void createRequestGroupForMetalink
90
 
(std::vector<SharedHandle<RequestGroup> >& result,
91
 
 const SharedHandle<Option>& option,
 
89
(std::vector<std::shared_ptr<RequestGroup>>& result,
 
90
 const std::shared_ptr<Option>& option,
92
91
 const std::string& metalinkData = "");
93
92
#endif // ENABLE_METALINK
94
93
 
100
99
// is created and uriListParser reads all input, this function returns
101
100
// false. The option is used as a option template.
102
101
bool createRequestGroupFromUriListParser
103
 
(std::vector<SharedHandle<RequestGroup> >& result,
 
102
(std::vector<std::shared_ptr<RequestGroup>>& result,
104
103
 const Option* option,
105
104
 UriListParser* uriListParser);
106
105
 
108
107
// then UriListParser is configured to read from standard input.
109
108
// Otherwise, this function first checks file denoted by filename
110
109
// exists.  If it does not exist, this function throws exception.
111
 
// This function returns SharedHandle<UriListParser> object if it
 
110
// This function returns std::shared_ptr<UriListParser> object if it
112
111
// succeeds.
113
 
SharedHandle<UriListParser> openUriListParser(const std::string& filename);
 
112
std::shared_ptr<UriListParser> openUriListParser(const std::string& filename);
114
113
 
115
114
// Create RequestGroup objects from reading file specified by input-file option.
116
115
// If the value of input-file option is "-", stdin is used as a input source.
118
117
// The additional out and dir options can be specified after each line of URIs.
119
118
// This optional line must start with white space(s).
120
119
void createRequestGroupForUriList
121
 
(std::vector<SharedHandle<RequestGroup> >& result,
122
 
 const SharedHandle<Option>& option);
 
120
(std::vector<std::shared_ptr<RequestGroup>>& result,
 
121
 const std::shared_ptr<Option>& option);
123
122
 
124
123
// Create RequestGroup object using provided uris.  If ignoreLocalPath
125
124
// is true, a path to torrent file abd metalink file are ignored.  If
128
127
// given. If throwOnError is false, these errors are just logged as
129
128
// error.
130
129
void createRequestGroupForUri
131
 
(std::vector<SharedHandle<RequestGroup> >& result,
132
 
 const SharedHandle<Option>& option,
 
130
(std::vector<std::shared_ptr<RequestGroup>>& result,
 
131
 const std::shared_ptr<Option>& option,
133
132
 const std::vector<std::string>& uris,
134
133
 bool ignoreForceSequential = false,
135
134
 bool ignoreLocalPath = false,
137
136
 
138
137
template<typename InputIterator>
139
138
void setMetadataInfo
140
 
(InputIterator first, InputIterator last, const SharedHandle<MetadataInfo>& mi)
 
139
(InputIterator first, InputIterator last,
 
140
 const std::shared_ptr<MetadataInfo>& mi)
141
141
{
142
142
  for(; first != last; ++first) {
143
143
    (*first)->setMetadataInfo(mi);
144
144
  }
145
145
}
146
146
 
147
 
SharedHandle<MetadataInfo>
148
 
createMetadataInfoFromFirstFileEntry(const SharedHandle<GroupId>& gid,
149
 
                                     const SharedHandle<DownloadContext>& dctx);
 
147
std::shared_ptr<MetadataInfo>
 
148
createMetadataInfoFromFirstFileEntry
 
149
(const std::shared_ptr<GroupId>& gid,
 
150
 const std::shared_ptr<DownloadContext>& dctx);
150
151
 
151
152
// Removes option value which is only effective at the first
152
153
// construction time.
153
 
void removeOneshotOption(const SharedHandle<Option>& option);
 
154
void removeOneshotOption(const std::shared_ptr<Option>& option);
154
155
 
155
156
} // namespace aria2
156
157