mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 05:47:57 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
74
components/files/configurationmanager.hpp
Normal file
74
components/files/configurationmanager.hpp
Normal file
|
@ -0,0 +1,74 @@
|
|||
#ifndef COMPONENTS_FILES_CONFIGURATIONMANAGER_HPP
|
||||
#define COMPONENTS_FILES_CONFIGURATIONMANAGER_HPP
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <boost/tr1/tr1/unordered_map>
|
||||
#elif defined HAVE_UNORDERED_MAP
|
||||
#include <unordered_map>
|
||||
#else
|
||||
#include <tr1/unordered_map>
|
||||
#endif
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <components/files/fixedpath.hpp>
|
||||
#include <components/files/collections.hpp>
|
||||
|
||||
/**
|
||||
* \namespace Files
|
||||
*/
|
||||
namespace Files
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct ConfigurationManager
|
||||
*/
|
||||
struct ConfigurationManager
|
||||
{
|
||||
ConfigurationManager();
|
||||
virtual ~ConfigurationManager();
|
||||
|
||||
void readConfiguration(boost::program_options::variables_map& variables,
|
||||
boost::program_options::options_description& description);
|
||||
void processPaths(Files::PathContainer& dataDirs);
|
||||
|
||||
/**< Fixed paths */
|
||||
const boost::filesystem::path& getGlobalPath() const;
|
||||
const boost::filesystem::path& getUserPath() const;
|
||||
const boost::filesystem::path& getLocalPath() const;
|
||||
|
||||
const boost::filesystem::path& getGlobalDataPath() const;
|
||||
const boost::filesystem::path& getUserDataPath() const;
|
||||
const boost::filesystem::path& getLocalDataPath() const;
|
||||
const boost::filesystem::path& getInstallPath() const;
|
||||
|
||||
const boost::filesystem::path& getCachePath() const;
|
||||
|
||||
const boost::filesystem::path& getLogPath() const;
|
||||
|
||||
private:
|
||||
typedef Files::FixedPath<> FixedPathType;
|
||||
|
||||
typedef const boost::filesystem::path& (FixedPathType::*path_type_f)() const;
|
||||
#if defined HAVE_UNORDERED_MAP
|
||||
typedef std::unordered_map<std::string, path_type_f> TokensMappingContainer;
|
||||
#else
|
||||
typedef std::tr1::unordered_map<std::string, path_type_f> TokensMappingContainer;
|
||||
#endif
|
||||
|
||||
void loadConfig(const boost::filesystem::path& path,
|
||||
boost::program_options::variables_map& variables,
|
||||
boost::program_options::options_description& description);
|
||||
|
||||
void setupTokensMapping();
|
||||
|
||||
FixedPathType mFixedPath;
|
||||
|
||||
boost::filesystem::path mLogPath;
|
||||
|
||||
TokensMappingContainer mTokensMapping;
|
||||
};
|
||||
|
||||
} /* namespace Cfg */
|
||||
|
||||
#endif /* COMPONENTS_FILES_CONFIGURATIONMANAGER_HPP */
|
Loading…
Add table
Add a link
Reference in a new issue