-
Notifications
You must be signed in to change notification settings - Fork 0
/
folder.hpp
38 lines (31 loc) · 838 Bytes
/
folder.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#pragma warning(disable: 4503)
#include <string>
#include <unordered_map>
#include <vector>
#include "panelitemslist.hpp"
/// directory contents
class FolderContent {
public:
FolderContent();
FolderContent(const std::wstring &dir);
const std::wstring &getDirName() const {
return dirName;
}
const PluginPanelItems &getItems() const {
return items;
}
bool read();
const PluginPanelItem *findItem(const std::wstring &name) const {
Name2item::const_iterator it = name2item.find(name);
return (it != name2item.end()) ? it->second : nullptr;
}
bool contains(const std::wstring &name) const {
return name2item.find(name) != name2item.end();
}
private:
typedef std::unordered_map<std::wstring, const PluginPanelItem *> Name2item;
Name2item name2item;
std::wstring dirName;
PluginPanelItems items;
};