Line | |
---|
1 | #pragma once
|
---|
2 |
|
---|
3 | namespace ActiveBasic{ namespace PM{ namespace FM{
|
---|
4 |
|
---|
5 |
|
---|
6 | class ItemBase
|
---|
7 | {
|
---|
8 | HTREEITEM hTreeItem;
|
---|
9 |
|
---|
10 | public:
|
---|
11 | ItemBase( HTREEITEM hTreeItem )
|
---|
12 | : hTreeItem( hTreeItem )
|
---|
13 | {
|
---|
14 | }
|
---|
15 |
|
---|
16 | HTREEITEM GetTreeItemHandle() const
|
---|
17 | {
|
---|
18 | return hTreeItem;
|
---|
19 | }
|
---|
20 | void SetTreeViewHandle( HTREEITEM hTreeItem )
|
---|
21 | {
|
---|
22 | this->hTreeItem = hTreeItem;
|
---|
23 | }
|
---|
24 | };
|
---|
25 |
|
---|
26 | class File
|
---|
27 | : public ItemBase
|
---|
28 | {
|
---|
29 | std::string relationalPath;
|
---|
30 |
|
---|
31 | public:
|
---|
32 | File( const std::string &relationalPath, HTREEITEM hTreeItem );
|
---|
33 |
|
---|
34 | const std::string &GetRelationalPath() const
|
---|
35 | {
|
---|
36 | return relationalPath;
|
---|
37 | }
|
---|
38 | const std::string GetFullPath() const;
|
---|
39 | };
|
---|
40 | typedef std::vector<File> Files;
|
---|
41 |
|
---|
42 | class Folder;
|
---|
43 | typedef std::vector<Folder> Folders;
|
---|
44 |
|
---|
45 | class Folder
|
---|
46 | : public ItemBase
|
---|
47 | {
|
---|
48 | std::string name;
|
---|
49 | public:
|
---|
50 | Files files;
|
---|
51 | Folders folders;
|
---|
52 |
|
---|
53 | Folder( const std::string &name, HTREEITEM hTreeItem )
|
---|
54 | : ItemBase( hTreeItem )
|
---|
55 | , name( name )
|
---|
56 | {
|
---|
57 | }
|
---|
58 |
|
---|
59 | const std::string &GetName() const
|
---|
60 | {
|
---|
61 | return name;
|
---|
62 | }
|
---|
63 |
|
---|
64 | bool IsEmpty() const;
|
---|
65 | void Clear();
|
---|
66 | File &FindFile( HTREEITEM hTreeItem );
|
---|
67 | File &FindFile( const std::string &path );
|
---|
68 | bool IsExistFile( HTREEITEM hTreeItem ) const;
|
---|
69 | bool IsExistFile( const std::string &path ) const;
|
---|
70 | void Remove( HTREEITEM hTreeItem );
|
---|
71 | };
|
---|
72 |
|
---|
73 | class FileSystem
|
---|
74 | {
|
---|
75 | public:
|
---|
76 | Folder root;
|
---|
77 | boost::mutex mutex;
|
---|
78 |
|
---|
79 | FileSystem( const std::string &rootFolderName )
|
---|
80 | : root( rootFolderName, NULL )
|
---|
81 | {
|
---|
82 | }
|
---|
83 | };
|
---|
84 |
|
---|
85 |
|
---|
86 | }}}
|
---|
Note:
See
TracBrowser
for help on using the repository browser.