VCMIDirs.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. // STL C++
  12. #include <string>
  13. #include <vector>
  14. // Boost
  15. #include <boost/filesystem/path.hpp>
  16. // TODO: File should be renamed to IVCMIDirs.h
  17. class DLL_LINKAGE IVCMIDirs
  18. {
  19. public:
  20. // Path to user-specific data directory
  21. virtual boost::filesystem::path userDataPath() const = 0;
  22. // Path to "cache" directory, can be used for any non-essential files
  23. virtual boost::filesystem::path userCachePath() const = 0;
  24. // Path to writeable directory with user configs
  25. virtual boost::filesystem::path userConfigPath() const = 0;
  26. // Path to saved games
  27. virtual boost::filesystem::path userSavePath() const;
  28. // Paths to global system-wide data directories. First items have higher priority
  29. virtual std::vector<boost::filesystem::path> dataPaths() const = 0;
  30. // Full path to client executable, including server name (e.g. /usr/bin/vcmiclient)
  31. virtual boost::filesystem::path clientPath() const = 0;
  32. // Full path to server executable, including server name (e.g. /usr/bin/vcmiserver)
  33. virtual boost::filesystem::path serverPath() const = 0;
  34. // Path where vcmi libraries can be found (in AI and Scripting subdirectories)
  35. virtual boost::filesystem::path libraryPath() const = 0;
  36. // Path where vcmi binaries can be found
  37. virtual boost::filesystem::path binaryPath() const = 0;
  38. // Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll")
  39. virtual std::string libraryName(const std::string& basename) const = 0;
  40. // virtual std::string libraryName(const char* basename) const = 0; ?
  41. // virtual std::string libraryName(std::string&& basename) const = 0;?
  42. virtual std::string genHelpString() const = 0;
  43. // Creates not existed, but required directories.
  44. // Updates directories what change name/path between versions.
  45. // Function called automatically.
  46. virtual void init();
  47. };
  48. namespace VCMIDirs
  49. {
  50. extern DLL_LINKAGE const IVCMIDirs& get();
  51. }