VCMIDirs.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 rename to IVCMIDirs.h
  17. class 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 = 0;
  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. };
  44. namespace VCMIDirs
  45. {
  46. extern DLL_LINKAGE const IVCMIDirs& get();
  47. }