VCMIDirs.h 2.7 KB

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