NullArchiveComponent.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <AzToolsFramework/Archive/ArchiveAPI.h>
  11. namespace AzToolsFramework
  12. {
  13. class NullArchiveComponent
  14. : public AZ::Component
  15. , private ArchiveCommandsBus::Handler
  16. {
  17. public:
  18. AZ_COMPONENT(NullArchiveComponent, "{D665B6B1-5FF4-4203-B19F-BBDB82587129}")
  19. NullArchiveComponent() = default;
  20. ~NullArchiveComponent() override = default;
  21. //////////////////////////////////////////////////////////////////////////
  22. // AZ::Component overrides
  23. void Activate() override;
  24. void Deactivate() override;
  25. //////////////////////////////////////////////////////////////////////////
  26. private:
  27. static void Reflect(AZ::ReflectContext* context);
  28. //////////////////////////////////////////////////////////////////////////
  29. // ArchiveCommandsBus::Handler overrides
  30. [[nodiscard]] std::future<bool> CreateArchive(
  31. const AZStd::string& archivePath,
  32. const AZStd::string& dirToArchive) override;
  33. [[nodiscard]] std::future<bool> ExtractArchive(
  34. const AZStd::string& archivePath,
  35. const AZStd::string& destinationPath) override;
  36. [[nodiscard]] std::future<bool> ExtractFile(
  37. const AZStd::string& archivePath,
  38. const AZStd::string& fileInArchive,
  39. const AZStd::string& destinationPath) override;
  40. bool ListFilesInArchive(const AZStd::string& archivePath, AZStd::vector<AZStd::string>& outFileEntries) override;
  41. [[nodiscard]] std::future<bool> AddFileToArchive(
  42. const AZStd::string& archivePath,
  43. const AZStd::string& workingDirectory,
  44. const AZStd::string& fileToAdd) override;
  45. [[nodiscard]] std::future<bool> AddFilesToArchive(
  46. const AZStd::string& archivePath,
  47. const AZStd::string& workingDirectory,
  48. const AZStd::string& listFilePath) override;
  49. //////////////////////////////////////////////////////////////////////////
  50. };
  51. } // namespace AzToolsFramework