HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEFilesList.cpp
Go to the documentation of this file.
1 #include <utility>
2 
3 #include "DRCEFilesList.hpp"
4 
5 namespace HCE
6 {
7 namespace drce
8 {
9 //-----------------------------------------------------------------------------
11 : name(""), data(""), actionType(0)
12 {
13 }
14 //-----------------------------------------------------------------------------
15 FileItem::FileItem(const std::string& name_, const std::string& data_, unsigned int actionType_)
16 : name(name_), data(data_), actionType(actionType_)
17 {
18 }
19 //-----------------------------------------------------------------------------
21 : name(""), data(""), actionType(0)
22 {
23  (*this) = rhs;
24 }
25 //-----------------------------------------------------------------------------
27 : name(""), data(""), actionType(0)
28 {
29  (*this) = std::forward<FileItem>(rhs);
30 }
31 //-----------------------------------------------------------------------------
33 {
34  if (this!=&rhs)
35  {
36  name = rhs.name;
37  data = rhs.data;
38  actionType = rhs.actionType;
39  }
40  return *this;
41 }
42 //-----------------------------------------------------------------------------
44 {
45  if (this!=&rhs)
46  {
47  name = std::move(rhs.name);
48  data = std::move(rhs.data);
49  actionType = std::move(rhs.actionType);
50  }
51  return *this;
52 }
53 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
56 : files()
57 {
58 }
60 {
61  if (this!=&rhs)
62  {
63  files = rhs.getFiles();
64  }
65  return *this;
66 }
67 //-----------------------------------------------------------------------------
69 {
70  if (this!=&rhs)
71  {
72  files = std::move(rhs.getFiles());
73  }
74  return *this;
75 }
76 //-----------------------------------------------------------------------------
77 void DRCEFilesList::addFileItem(const FileItem& fileItem)
78 {
79  files.push_back(fileItem);
80 }
81 //-----------------------------------------------------------------------------
83 {
84  files.push_back(std::move(std::forward<FileItem>(fileItem)));
85 }
86 //-----------------------------------------------------------------------------
87 void DRCEFilesList::addFileItem(const std::string& name, const std::string& data, unsigned int actionType)
88 {
89  files.push_back(std::move(std::forward<FileItem>(FileItem(name, data, actionType))));
90 }
91 //-----------------------------------------------------------------------------
92 size_t DRCEFilesList::getFilesCount(void) const
93 {
94  return files.size();
95 }
96 //-----------------------------------------------------------------------------
98 {
99  return files[index];
100 }
101 //-----------------------------------------------------------------------------
102 void DRCEFilesList::setFileItem(size_t index, const FileItem& fileItem)
103 {
104  files[index] = fileItem;
105 }
106 //-----------------------------------------------------------------------------
107 void DRCEFilesList::setFileItem(size_t index, FileItem&& fileItem)
108 {
109  files[index] = std::forward<FileItem>(fileItem);
110 }
111 //-----------------------------------------------------------------------------
113 {
114  files.clear();
115 }
116 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 } // namespace drce
119 } // namespace HCE