1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/lib/VCMIDirs.h
Ivan Savenko 5cbec833c2 - (linux) XDG filesystem support
BIG NOTE TO LINUX USERS
All user data has been moved according to XDG specs:
- Game data (H3 files and mods) and saves: from ~/.vcmi to ~/.local/
- Temporary files, including logs: from ~/.vcmi to ~/.cache/vcmi
- Config files: from ~/.vcmi/config to ~/.config/vcmi

For compatibility VCMI will read game data from ~/.vcmi as well but this
is temporary behavior and will be removed
2014-03-04 14:51:10 +00:00

51 lines
1.4 KiB
C++

#pragma once
#include "GameConstants.h"
/*
* VCMIDirs.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
*
*/
/// Where to find the various VCMI files. This is mostly useful for linux.
class DLL_LINKAGE VCMIDirs
{
public:
VCMIDirs();
/// get singleton instance
static VCMIDirs & get();
/// Path to user-specific data directory
std::string userDataPath() const;
/// Path to "cache" directory, can be used for any non-essential files
std::string userCachePath() const;
/// Path to writeable directory with user configs
std::string userConfigPath() const;
/// Path to saved games
std::string userSavePath() const;
/// Paths to global system-wide data directories. First items have higher priority
std::vector<std::string> dataPaths() const;
/// Full path to client executable, including server name (e.g. /usr/bin/vcmiclient)
std::string clientPath() const;
/// Full path to server executable, including server name (e.g. /usr/bin/vcmiserver)
std::string serverPath() const;
/// Path where vcmi libraries can be found (in AI and Scripting subdirectories)
std::string libraryPath() const;
/// Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll")
std::string libraryName(std::string basename) const;
};