Project.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #include <Atomic/Core/Object.h>
  2. #include <Atomic/IO/FileSystem.h>
  3. using namespace Atomic;
  4. #include "../Platform/Platform.h"
  5. namespace ToolCore
  6. {
  7. class Project : public Object
  8. {
  9. OBJECT(Project);
  10. public:
  11. /// Construct.
  12. Project(Context* context);
  13. /// Destruct.
  14. virtual ~Project();
  15. void Load(const String& fullpath);
  16. void Save(const String& fullpath = "");
  17. /// Paths
  18. const String GetResourcePath() { return resourcePath_; }
  19. void SetResourcePath(const String& resourcePath)
  20. {
  21. resourcePath_ = AddTrailingSlash(resourcePath);
  22. componentsPath_ = resourcePath_ + "Components";
  23. scriptsPath_ = resourcePath_ + "Scripts";
  24. modulesPath_ = resourcePath_ + "Modules";
  25. }
  26. const String& GetComponentsPath() { return componentsPath_; }
  27. const String& GetScriptsPath() { return scriptsPath_; }
  28. const String& GetModulesPath() { return modulesPath_; }
  29. const String& GetProjectFilePath() { return projectFilePath_; }
  30. bool IsComponentsDirOrFile(const String& fullPath);
  31. bool IsScriptsDirOrFile(const String& fullPath);
  32. bool IsModulesDirOrFile(const String& fullPath);
  33. const String& GetLastBuildPath() { return lastBuildPath_; }
  34. void SetLastBuildPath(const String& path) { lastBuildPath_ = path; }
  35. void SaveBuildSettings(const String& path);
  36. bool LoadBuildSettings(const String& path);
  37. void AddPlatform(PlatformID platformID);
  38. void RemovePlatform(PlatformID platformID);
  39. private:
  40. void LoadUserPrefs(const String& fullpath);
  41. void SaveUserPrefs(const String& fullpath);
  42. String GetUserPrefsFullPath(const String& projectPath);
  43. String projectFilePath_;
  44. String resourcePath_;
  45. String componentsPath_;
  46. String scriptsPath_;
  47. String modulesPath_;
  48. String lastBuildPath_;
  49. VariantMap buildSettings_;
  50. List<SharedPtr<Platform>> platforms_;
  51. };
  52. }