ScummVM API documentation
search_manager.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ZVISION_SEARCH_MANAGER_H
23 #define ZVISION_SEARCH_MANAGER_H
24 
25 #include "common/str.h"
26 #include "common/hash-str.h"
27 #include "common/hashmap.h"
28 #include "common/archive.h"
29 #include "common/file.h"
30 #include "common/list.h"
31 
32 namespace ZVision {
33 
35 public:
36  SearchManager(const Common::Path &rootPath, int depth);
37  ~SearchManager();
38 
39  void addFile(const Common::Path &name, Common::Archive *arch);
40  void addDir(const Common::Path &name);
41 
42  Common::File *openFile(const Common::Path &name);
43  bool openFile(Common::File &file, const Common::Path &name);
44  bool hasFile(const Common::Path &name);
45 
46  bool loadZix(const Common::Path &name);
47 
48  struct Node {
49  Common::Path name;
50  Common::Archive *arch;
51  };
52 
54 
55  void listMembersWithExtension(MatchList &fileList, Common::String extension);
56 
57 private:
58 
59  void listDirRecursive(Common::List<Common::Path> &dirList, const Common::FSNode &fsNode, int depth);
60 
63  Common::Path _root;
64  MatchList _files;
65 };
66 
67 }
68 
69 #endif // ZVISION_SEARCH_MANAGER_H
Definition: str.h:59
Definition: search_manager.h:48
Definition: path.h:52
Definition: clock.h:29
Definition: archive.h:141
Definition: search_manager.h:34
Definition: file.h:47
Definition: fs.h:69