2
0

VCMIDirs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * VCMIDirs.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. class DLL_LINKAGE IVCMIDirs
  12. {
  13. public:
  14. // Path to user-specific data directory
  15. virtual boost::filesystem::path userDataPath() const = 0;
  16. // Path to "cache" directory, can be used for any non-essential files
  17. virtual boost::filesystem::path userCachePath() const = 0;
  18. // Path to writeable directory with user configs
  19. virtual boost::filesystem::path userConfigPath() const = 0;
  20. // Path to saved games
  21. virtual boost::filesystem::path userSavePath() const;
  22. // Paths to global system-wide data directories. First items have higher priority
  23. virtual std::vector<boost::filesystem::path> dataPaths() const = 0;
  24. // Full path to client executable, including server name (e.g. /usr/bin/vcmiclient)
  25. virtual boost::filesystem::path clientPath() const = 0;
  26. // Full path to server executable, including server name (e.g. /usr/bin/vcmiserver)
  27. virtual boost::filesystem::path serverPath() const = 0;
  28. // Path where vcmi libraries can be found (in AI and Scripting subdirectories)
  29. virtual boost::filesystem::path libraryPath() const = 0;
  30. // absolute path to passed library (needed due to android libs being placed in single dir, not respecting original lib dirs;
  31. // by default just concats libraryPath, given folder and libraryName
  32. virtual boost::filesystem::path fullLibraryPath(const std::string & desiredFolder,
  33. const std::string & baseLibName) const;
  34. // Path where vcmi binaries can be found
  35. virtual boost::filesystem::path binaryPath() const = 0;
  36. // Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll")
  37. virtual std::string libraryName(const std::string & basename) const = 0;
  38. // virtual std::string libraryName(const char* basename) const = 0; ?
  39. // virtual std::string libraryName(std::string&& basename) const = 0;?
  40. virtual std::string genHelpString() const = 0;
  41. // Creates not existed, but required directories.
  42. // Updates directories what change name/path between versions.
  43. // Function called automatically.
  44. virtual void init();
  45. };
  46. namespace VCMIDirs
  47. {
  48. extern DLL_LINKAGE const IVCMIDirs & get();
  49. }