Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestArchive.cpp @ 3712:2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 15:32:45 +0100 |
parents | 94f4a18a79cc |
children | 6ddad3e0b569 |
comparison
equal
deleted
inserted
replaced
3709:1f4910999fe7 | 3712:2a170a8f1faf |
---|---|
121 } | 121 } |
122 | 122 |
123 | 123 |
124 static void SubmitJob(RestApiOutput& output, | 124 static void SubmitJob(RestApiOutput& output, |
125 ServerContext& context, | 125 ServerContext& context, |
126 std::auto_ptr<ArchiveJob>& job, | 126 std::unique_ptr<ArchiveJob>& job, |
127 int priority, | 127 int priority, |
128 bool synchronous, | 128 bool synchronous, |
129 const std::string& filename) | 129 const std::string& filename) |
130 { | 130 { |
131 if (job.get() == NULL) | 131 if (job.get() == NULL) |
177 { | 177 { |
178 bool synchronous, extended; | 178 bool synchronous, extended; |
179 int priority; | 179 int priority; |
180 GetJobParameters(synchronous, extended, priority, body, DEFAULT_IS_EXTENDED); | 180 GetJobParameters(synchronous, extended, priority, body, DEFAULT_IS_EXTENDED); |
181 | 181 |
182 std::auto_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); | 182 std::unique_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); |
183 AddResourcesOfInterest(*job, body); | 183 AddResourcesOfInterest(*job, body); |
184 SubmitJob(call.GetOutput(), context, job, priority, synchronous, "Archive.zip"); | 184 SubmitJob(call.GetOutput(), context, job, priority, synchronous, "Archive.zip"); |
185 } | 185 } |
186 else | 186 else |
187 { | 187 { |
207 else | 207 else |
208 { | 208 { |
209 extended = false; | 209 extended = false; |
210 } | 210 } |
211 | 211 |
212 std::auto_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); | 212 std::unique_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); |
213 job->AddResource(id); | 213 job->AddResource(id); |
214 | 214 |
215 SubmitJob(call.GetOutput(), context, job, 0 /* priority */, | 215 SubmitJob(call.GetOutput(), context, job, 0 /* priority */, |
216 true /* synchronous */, id + ".zip"); | 216 true /* synchronous */, id + ".zip"); |
217 } | 217 } |
230 { | 230 { |
231 bool synchronous, extended; | 231 bool synchronous, extended; |
232 int priority; | 232 int priority; |
233 GetJobParameters(synchronous, extended, priority, body, DEFAULT_IS_EXTENDED); | 233 GetJobParameters(synchronous, extended, priority, body, DEFAULT_IS_EXTENDED); |
234 | 234 |
235 std::auto_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); | 235 std::unique_ptr<ArchiveJob> job(new ArchiveJob(context, IS_MEDIA, extended)); |
236 job->AddResource(id); | 236 job->AddResource(id); |
237 SubmitJob(call.GetOutput(), context, job, priority, synchronous, id + ".zip"); | 237 SubmitJob(call.GetOutput(), context, job, priority, synchronous, id + ".zip"); |
238 } | 238 } |
239 else | 239 else |
240 { | 240 { |