VCMIDirs.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include "GameConstants.h"
  3. /*
  4. * VCMIDirs.h, part of VCMI engine
  5. *
  6. * Authors: listed in file AUTHORS in main folder
  7. *
  8. * License: GNU General Public License v2.0 or later
  9. * Full text of license available in license.txt file, in main folder
  10. *
  11. */
  12. /// Where to find the various VCMI files. This is mostly useful for linux.
  13. class DLL_LINKAGE VCMIDirs
  14. {
  15. public:
  16. VCMIDirs();
  17. /// get singleton instance
  18. static VCMIDirs & get();
  19. /// Path to user-specific data directory
  20. std::string userDataPath() const;
  21. /// Path to "cache" directory, can be used for any non-essential files
  22. std::string userCachePath() const;
  23. /// Path to writeable directory with user configs
  24. std::string userConfigPath() const;
  25. /// Path to saved games
  26. std::string userSavePath() const;
  27. /// Path to config directories, e.g. <data dir>/config. First items have higher priority
  28. std::vector<std::string> configPaths() const;
  29. /// Paths to global system-wide data directories. First items have higher priority
  30. std::vector<std::string> dataPaths() const;
  31. /// Full path to client executable, including server name (e.g. /usr/bin/vcmiclient)
  32. std::string clientPath() const;
  33. /// Full path to server executable, including server name (e.g. /usr/bin/vcmiserver)
  34. std::string serverPath() const;
  35. /// Path where vcmi libraries can be found (in AI and Scripting subdirectories)
  36. std::string libraryPath() const;
  37. /// Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll")
  38. std::string libraryName(std::string basename) const;
  39. };