OpenXcom  1.0
Open-source clone of the original X-Com
FileMap.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom 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  * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <set>
21 #include <string>
22 #include <vector>
23 
24 namespace OpenXcom
25 {
26 
31 namespace FileMap
32 {
36  const std::string &getFilePath(const std::string &relativeFilePath);
37 
41  const std::set<std::string> &getVFolderContents(const std::string &relativePath);
42 
44  std::set<std::string> filterFiles(const std::vector<std::string> &files, const std::string &ext);
45  std::set<std::string> filterFiles(const std::set<std::string> &files, const std::string &ext);
46 
49  const std::vector<std::pair<std::string, std::vector<std::string> > > &getRulesets();
50 
52  void clear();
53 
58  void load(const std::string &modId, const std::string &path, bool ignoreMods);
59 
61  bool isResourcesEmpty(void);
62 }
63 
64 }
const std::set< std::string > & getVFolderContents(const std::string &relativePath)
Returns the set of files in a virtual folder. The virtual folder contains files from all active mods ...
Definition: FileMap.cpp:55
void load(const std::string &modId, const std::string &path, bool ignoreMods)
Scans a directory tree rooted at the specified filesystem path. Any files it encounters that have alr...
Definition: FileMap.cpp:178
std::set< std::string > filterFiles(const std::vector< std::string > &files, const std::string &ext)
Returns the subset of the given files that matches the given extension.
Definition: FileMap.cpp:91
const std::vector< std::pair< std::string, std::vector< std::string > > > & getRulesets()
Returns the ruleset files found, grouped by mod, while mapping resources. The highest-priority mod wi...
Definition: FileMap.cpp:94
bool isResourcesEmpty(void)
Determines if _resources set is empty.
Definition: FileMap.cpp:184
void clear()
clears FileMap state
Definition: FileMap.cpp:171
Definition: BaseInfoState.cpp:40
const std::string & getFilePath(const std::string &relativeFilePath)
Gets the real filesystem path for a data file when given a relative (case insensitive) path...
Definition: FileMap.cpp:43