1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-26 08:41:13 +02:00
vcmi/lib/VCMIDirs.h
Ivan Savenko 4ac2a6e8b6 minor refactoring of VCMIDirs, bugfixing
- VCMIDirs represent XDG specification more closely (partial #1310)
- Minor bugfixing, including #1327 #1328 and #1306
2013-07-08 20:55:22 +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;
/// Path to config directories, e.g. <data dir>/config. First items have higher priority
std::vector<std::string> configPaths() const;
/// Paths to global system-wide data directories. First items have higher priority
std::vector<std::string> dataPaths() const;
/// Full path to vcmiserver 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;
};