BsProjectLibraryEntries.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsProjectLibrary.h"
  4. #include "BsIReflectable.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Contains a list of entries used by the ProjectLibrary. Used primarily
  9. * for serialization purposes, i.e. persisting ProjectLibrary state
  10. * between application runs.
  11. */
  12. class ProjectLibraryEntries : public IReflectable
  13. {
  14. struct ConstructPrivately { };
  15. public:
  16. explicit ProjectLibraryEntries(const ConstructPrivately& dummy);
  17. ProjectLibraryEntries(const ProjectLibrary::DirectoryEntry& rootEntry);
  18. /**
  19. * @brief Creates new project library entries based on a ProjectLibrary root directory entry.
  20. *
  21. * @param rootEntry Root directory entry in ProjectLibrary.
  22. */
  23. static std::shared_ptr<ProjectLibraryEntries> create(const ProjectLibrary::DirectoryEntry& rootEntry);
  24. /**
  25. * @brief Returns the root directory entry that references the entire entry hierarchy.
  26. */
  27. const ProjectLibrary::DirectoryEntry& getRootEntry() const { return mRootEntry; }
  28. private:
  29. ProjectLibrary::DirectoryEntry mRootEntry;
  30. /************************************************************************/
  31. /* SERIALIZATION */
  32. /************************************************************************/
  33. /**
  34. * @brief Creates new empty project library entries object. Used for serialization
  35. * purposes.
  36. */
  37. static std::shared_ptr<ProjectLibraryEntries> createEmpty();
  38. public:
  39. friend class ProjectLibraryEntriesRTTI;
  40. static RTTITypeBase* getRTTIStatic();
  41. virtual RTTITypeBase* getRTTI() const override;
  42. };
  43. }