Line data Source code
1 : ///
2 : /// @file ar/extraction.cpp
3 : /// @copyright (c) 2015 by Petr Zemek (s3rvac@gmail.com) and contributors
4 : /// @license MIT, see the @c LICENSE file for more details
5 : /// @brief Implementation of archive extraction.
6 : ///
7 :
8 : #include "ar/extraction.h"
9 : #include "ar/file.h"
10 : #include "ar/internal/extractor.h"
11 :
12 : using namespace ar::internal;
13 :
14 : namespace ar {
15 :
16 : ///
17 : /// Extracts the given archive and returns the files it contains.
18 : ///
19 : /// @throws InvalidArchiveError when the archive is invalid.
20 : ///
21 3 : Files extract(std::unique_ptr<File> archive) {
22 6 : Extractor extractor;
23 5 : return extractor.extract(archive->getContent());
24 : }
25 :
26 : } // namespace ar
|