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