BuilderConfigurationManager.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 <native/utilities/BuilderConfigurationBus.h>
  10. #include <AssetBuilderSDK/AssetBuilderSDK.h>
  11. #include <AzCore/std/containers/unordered_map.h>
  12. #include <AzCore/std/string/string.h>
  13. #include <QVariant>
  14. namespace AssetProcessor
  15. {
  16. const char BuilderConfigFile[] = "BuilderConfig.ini";
  17. class BuilderConfigurationManager :
  18. public BuilderConfigurationRequestBus::Handler
  19. {
  20. public:
  21. using ParamMap = AZStd::unordered_map<AZStd::string, QVariant>;
  22. using ConfigMap = AZStd::unordered_map <AZStd::string, ParamMap>;
  23. BuilderConfigurationManager();
  24. ~BuilderConfigurationManager();
  25. //BuilderConfigurationRequestBus
  26. bool LoadConfiguration(const AZStd::string& configFile) override;
  27. bool UpdateJobDescriptor(const AZStd::string& jobKey, AssetBuilderSDK::JobDescriptor& jobDesc) override;
  28. bool UpdateBuilderDescriptor(const AZStd::string& builderName, AssetBuilderSDK::AssetBuilderDesc& jobDesc) override;
  29. bool IsLoaded() const { return m_loaded; }
  30. private:
  31. ConfigMap m_builderSettings;
  32. ConfigMap m_jobSettings;
  33. bool m_loaded{ false };
  34. };
  35. } // namespace AssetProcessor