2014-08-09 18:22:37 +03:00
|
|
|
/*
|
2017-07-13 10:26:03 +02:00
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2011-12-14 00:23:17 +03:00
|
|
|
#pragma once
|
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2014-08-11 00:42:39 +03:00
|
|
|
class DLL_LINKAGE IVCMIDirs
|
2014-08-09 20:54:12 +03:00
|
|
|
{
|
2017-05-25 19:57:20 +02:00
|
|
|
public:
|
|
|
|
// Path to user-specific data directory
|
|
|
|
virtual boost::filesystem::path userDataPath() const = 0;
|
2009-10-10 18:09:02 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Path to "cache" directory, can be used for any non-essential files
|
|
|
|
virtual boost::filesystem::path userCachePath() const = 0;
|
2009-10-10 18:09:02 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Path to writeable directory with user configs
|
|
|
|
virtual boost::filesystem::path userConfigPath() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2022-09-17 15:56:01 +02:00
|
|
|
// Path to writeable directory to store log files
|
|
|
|
virtual boost::filesystem::path userLogsPath() const;
|
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Path to saved games
|
|
|
|
virtual boost::filesystem::path userSavePath() const;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2022-11-24 22:15:46 +02:00
|
|
|
// Path to "extracted" directory, used to temporarily hold extracted Original H3 files
|
|
|
|
virtual boost::filesystem::path userExtractedPath() const;
|
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Paths to global system-wide data directories. First items have higher priority
|
|
|
|
virtual std::vector<boost::filesystem::path> dataPaths() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2022-12-25 23:08:39 +02:00
|
|
|
// Full path to client executable, including name (e.g. /usr/bin/vcmiclient)
|
2017-05-25 19:57:20 +02:00
|
|
|
virtual boost::filesystem::path clientPath() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2022-12-25 23:08:39 +02:00
|
|
|
// Full path to editor executable, including name (e.g. /usr/bin/vcmieditor)
|
2022-12-28 17:59:16 +02:00
|
|
|
virtual boost::filesystem::path mapEditorPath() const = 0;
|
2022-12-25 23:08:39 +02:00
|
|
|
|
|
|
|
// Full path to server executable, including name (e.g. /usr/bin/vcmiserver)
|
2017-05-25 19:57:20 +02:00
|
|
|
virtual boost::filesystem::path serverPath() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Path where vcmi libraries can be found (in AI and Scripting subdirectories)
|
|
|
|
virtual boost::filesystem::path libraryPath() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// absolute path to passed library (needed due to android libs being placed in single dir, not respecting original lib dirs;
|
|
|
|
// by default just concats libraryPath, given folder and libraryName
|
|
|
|
virtual boost::filesystem::path fullLibraryPath(const std::string & desiredFolder,
|
|
|
|
const std::string & baseLibName) const;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Path where vcmi binaries can be found
|
|
|
|
virtual boost::filesystem::path binaryPath() const = 0;
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2017-05-25 19:57:20 +02:00
|
|
|
// Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll")
|
|
|
|
virtual std::string libraryName(const std::string & basename) const = 0;
|
|
|
|
// virtual std::string libraryName(const char* basename) const = 0; ?
|
|
|
|
// virtual std::string libraryName(std::string&& basename) const = 0;?
|
|
|
|
|
2022-09-17 15:52:14 +02:00
|
|
|
virtual std::string genHelpString() const;
|
2017-05-25 19:57:20 +02:00
|
|
|
|
|
|
|
// Creates not existed, but required directories.
|
|
|
|
// Updates directories what change name/path between versions.
|
|
|
|
// Function called automatically.
|
|
|
|
virtual void init();
|
2014-08-09 20:54:12 +03:00
|
|
|
};
|
2014-08-09 18:22:37 +03:00
|
|
|
|
2014-08-09 20:54:12 +03:00
|
|
|
namespace VCMIDirs
|
2014-08-09 18:22:37 +03:00
|
|
|
{
|
2017-05-25 19:57:20 +02:00
|
|
|
extern DLL_LINKAGE const IVCMIDirs & get();
|
2016-01-31 17:01:58 +02:00
|
|
|
}
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|