mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Added file missing from previous commit.
This commit is contained in:
parent
b02d4c1c2f
commit
c4e82959f1
35
lib/VCMIDirs.h
Normal file
35
lib/VCMIDirs.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* UserHome.h, part of VCMI engine
|
||||
*
|
||||
* Authors: listed in file AUTHORS in main folder
|
||||
*
|
||||
* License: GNU General Public License v2.0 or later
|
||||
* Full text of license available in license.txt file, in main folder
|
||||
*
|
||||
*/
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
using namespace boost::filesystem;
|
||||
|
||||
/* Where to find the various VCMI files. This is mostly usefull for linux. */
|
||||
class VCMIDirs {
|
||||
public:
|
||||
std::string UserPath;
|
||||
|
||||
VCMIDirs()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
UserPath = DATA_DIR;
|
||||
#else
|
||||
// Find vcmi user directory and create it if necessary
|
||||
std::string home_dir = getenv("HOME");
|
||||
UserPath = path(home_dir + "/.vcmi").string();
|
||||
|
||||
create_directory(UserPath);
|
||||
create_directory(UserPath + "/config");
|
||||
create_directory(UserPath + "/Games");
|
||||
#endif
|
||||
}
|
||||
};
|
||||
extern VCMIDirs GVCMIDirs;
|
Loading…
Reference in New Issue
Block a user