File: VCMIDirs.h

package info (click to toggle)
vcmi 0.99%2Bdfsg%2Bgit20190113.f06c8a87-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 11,136 kB
  • sloc: cpp: 142,615; sh: 315; objc: 248; makefile: 32; ansic: 28; python: 13
file content (63 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * 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
 *
 */
#pragma once

class DLL_LINKAGE IVCMIDirs
{
public:
	// Path to user-specific data directory
	virtual boost::filesystem::path userDataPath() const = 0;

	// Path to "cache" directory, can be used for any non-essential files
	virtual boost::filesystem::path userCachePath() const = 0;

	// Path to writeable directory with user configs
	virtual boost::filesystem::path userConfigPath() const = 0;

	// Path to saved games
	virtual boost::filesystem::path userSavePath() const;

	// Paths to global system-wide data directories. First items have higher priority
	virtual std::vector<boost::filesystem::path> dataPaths() const = 0;

	// Full path to client executable, including server name (e.g. /usr/bin/vcmiclient)
	virtual boost::filesystem::path clientPath() const = 0;

	// Full path to server executable, including server name (e.g. /usr/bin/vcmiserver)
	virtual boost::filesystem::path serverPath() const = 0;

	// Path where vcmi libraries can be found (in AI and Scripting subdirectories)
	virtual boost::filesystem::path libraryPath() const = 0;

	// 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;

	// Path where vcmi binaries can be found
	virtual boost::filesystem::path binaryPath() const = 0;

	// 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;?

	virtual std::string genHelpString() const = 0;

	// Creates not existed, but required directories.
	// Updates directories what change name/path between versions.
	// Function called automatically.
	virtual void init();
};

namespace VCMIDirs
{
	extern DLL_LINKAGE const IVCMIDirs & get();
}