1 | #include "cpr/file.h" |
---|---|
2 | |
3 | namespace cpr { |
4 | |
5 | Files::Files(const std::initializer_list<std::string>& p_filepaths) { |
6 | for (const std::string& filepath : p_filepaths) { |
7 | files.emplace_back(args: filepath); |
8 | } |
9 | } |
10 | |
11 | Files::iterator Files::begin() { |
12 | return files.begin(); |
13 | } |
14 | |
15 | Files::iterator Files::end() { |
16 | return files.end(); |
17 | } |
18 | |
19 | Files::const_iterator Files::begin() const { |
20 | return files.begin(); |
21 | } |
22 | |
23 | Files::const_iterator Files::end() const { |
24 | return files.end(); |
25 | } |
26 | |
27 | Files::const_iterator Files::cbegin() const { |
28 | return files.cbegin(); |
29 | } |
30 | |
31 | Files::const_iterator Files::cend() const { |
32 | return files.cend(); |
33 | } |
34 | |
35 | void Files::emplace_back(const File& file) { |
36 | files.emplace_back(args: file); |
37 | } |
38 | |
39 | void Files::push_back(const File& file) { |
40 | files.push_back(x: file); |
41 | } |
42 | |
43 | void Files::pop_back() { |
44 | files.pop_back(); |
45 | } |
46 | |
47 | Files& Files::operator=(const Files& other) { |
48 | if (&other != this) { |
49 | files = other.files; |
50 | } |
51 | return *this; |
52 | } |
53 | |
54 | Files& Files::operator=(Files&& old) noexcept { |
55 | if (&old != this) { |
56 | files = std::move(old.files); |
57 | } |
58 | return *this; |
59 | } |
60 | } // namespace cpr |
61 |