Last change
on this file since 822 was 816, checked in by イグトランス (egtra), 13 years ago |
ab_commonにおいて、各クラスのコピー禁止を明確化、ならびにコピー可能なものにムーブコンストラクタ・ムーブ代入演算子を追加
|
File size:
1.3 KB
|
Rev | Line | |
---|
[622] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | namespace ActiveBasic{ namespace Common{
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | struct ResourceItem
|
---|
| 7 | {
|
---|
| 8 | std::string idName;
|
---|
| 9 | std::string filepath;
|
---|
| 10 |
|
---|
| 11 | // IDEのみで使う
|
---|
| 12 | HTREEITEM hTreeItem;
|
---|
[816] | 13 |
|
---|
| 14 | ResourceItem()
|
---|
| 15 | : idName()
|
---|
| 16 | , filepath()
|
---|
| 17 | , hTreeItem() {}
|
---|
| 18 |
|
---|
| 19 | ResourceItem(ResourceItem&& y)
|
---|
| 20 | : idName(std::move(y.idName))
|
---|
| 21 | , filepath(std::move(y.filepath))
|
---|
| 22 | , hTreeItem(std::move(y.hTreeItem)) {}
|
---|
| 23 |
|
---|
| 24 | ResourceItem(ResourceItem const& y)
|
---|
| 25 | : idName(y.idName)
|
---|
| 26 | , filepath(y.filepath)
|
---|
| 27 | , hTreeItem(y.hTreeItem) {}
|
---|
| 28 |
|
---|
| 29 | ResourceItem& operator =(ResourceItem&& y)
|
---|
| 30 | {
|
---|
| 31 | idName = std::move(y.idName);
|
---|
| 32 | filepath= std::move(y.filepath);
|
---|
| 33 | hTreeItem = std::move(y.hTreeItem);
|
---|
| 34 | return *this;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | ResourceItem& operator =(ResourceItem const& y)
|
---|
| 38 | {
|
---|
| 39 | return *this = std::move(ResourceItem(y));
|
---|
| 40 | }
|
---|
[622] | 41 | };
|
---|
[816] | 42 |
|
---|
[622] | 43 | typedef std::vector<ResourceItem> ResourceItems;
|
---|
| 44 |
|
---|
| 45 |
|
---|
| 46 | class ResourceManager
|
---|
| 47 | {
|
---|
| 48 | public:
|
---|
[816] | 49 | ResourceManager() {}
|
---|
| 50 |
|
---|
[622] | 51 | void Clear();
|
---|
| 52 | bool Load( const std::string &resourceFilePath );
|
---|
| 53 | bool Save( const std::string &resourceFilePath );
|
---|
| 54 |
|
---|
| 55 | bool HasManifest() const;
|
---|
| 56 |
|
---|
| 57 | ResourceItems cursorResources;
|
---|
| 58 | ResourceItems bitmapResources;
|
---|
| 59 | ResourceItems iconResources;
|
---|
| 60 | std::string manifestFilePath;
|
---|
[816] | 61 |
|
---|
| 62 | private:
|
---|
| 63 | ResourceManager(ResourceManager const&);
|
---|
| 64 | ResourceManager operator =(ResourceManager const&);
|
---|
[622] | 65 | };
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | }}
|
---|
Note:
See
TracBrowser
for help on using the repository browser.