CCombinedContainer.h 998 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "CContainer.h"
  3. #include <filesystem>
  4. #include <stdexcept>
  5. #include <vector>
  6. namespace WallpaperEngine::Assets {
  7. /**
  8. * A meta-container that allows backgrounds to have files spread across different containers
  9. */
  10. class CCombinedContainer final : public CContainer {
  11. public:
  12. CCombinedContainer ();
  13. /**
  14. * Adds a container to the list
  15. *
  16. * @param container
  17. */
  18. void add (CContainer* container);
  19. /**
  20. * Adds the given package to the list
  21. *
  22. * @param path
  23. */
  24. void addPkg (const std::filesystem::path& path);
  25. /** @inheritdoc */
  26. [[nodiscard]] std::filesystem::path resolveRealFile (const std::string& filename) const override;
  27. /** @inheritdoc */
  28. [[nodiscard]] const uint8_t* readFile (const std::string& filename, uint32_t* length) const override;
  29. private:
  30. /** The list of containers to search files off from */
  31. std::vector<CContainer*> m_containers;
  32. };
  33. }; // namespace WallpaperEngine::Assets