wfut 0.2.4
A client side C++ implementation of WFUT (WorldForge Update Tool).
ChannelFileList.h
1// This file may be redistributed and modified only under the terms of
2// the GNU Lesser General Public License (See COPYING for details).
3// Copyright (C) 2005 - 2007 Simon Goodall
4
5#ifndef LIBWFUT_CHANNELFILELIST_H
6#define LIBWFUT_CHANNELFILELIST_H 1
7
8#include <string>
9
10#include <libwfut/types.h>
11
12namespace WFUT {
18public:
19 ChannelFileList() = default;
20 virtual ~ChannelFileList() = default;
21
25 std::string getName() const { return m_name; }
26
30 void setName(const std::string &name) { m_name = name; }
31
36 const FileMap &getFiles() const { return m_fileMap; }
37
41 void addFile(const FileObject &fo) { m_fileMap[fo.filename] = fo ; }
42
46 void removeFile(const std::string &filename) {
47 auto I = m_fileMap.find(filename);
48 if (I != m_fileMap.end()) m_fileMap.erase(I);
49 }
50
54 void clear() { m_fileMap.clear(); }
55
59 size_t size() const { return m_fileMap.size(); }
60
61private:
62 std::string m_name;
63 std::map<std::string, FileObject> m_fileMap;
64
65};
66
67} /* namespace WFUT */
68
69#endif /* LIBWFUT_CHANNELLIST_H */
std::string getName() const
void addFile(const FileObject &fo)
const FileMap & getFiles() const
void setName(const std::string &name)
void removeFile(const std::string &filename)