Application.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 <AzToolsFramework/Application/ToolsApplication.h>
  10. #include <AzCore/IO/Path/Path.h>
  11. namespace AZ::IO
  12. {
  13. class FileDescriptorCapturer;
  14. }
  15. namespace AZ::SerializeContextTools
  16. {
  17. class Application final
  18. : public AzToolsFramework::ToolsApplication
  19. {
  20. public:
  21. AZ_CLASS_ALLOCATOR(Application, AZ::SystemAllocator)
  22. Application(int argc, char** argv, AZ::IO::FileDescriptorCapturer* stdoutCapturer = {});
  23. ~Application() override = default;
  24. const char* GetConfigFilePath() const;
  25. AZ::ComponentTypeList GetRequiredSystemComponents() const override;
  26. void QueryApplicationType(AZ::ApplicationTypeQuery& appType) const override;
  27. //! Associates a FileDescriptorCapturer with the SerializeContextApplication that
  28. //! redirects stdout to a visitor callback.
  29. //! The FileDescriptorCapturer supports a write bypass to force writing to stdout if need be
  30. void SetStdoutCapturer(AZ::IO::FileDescriptorCapturer* stdoutCapturer);
  31. AZ::IO::FileDescriptorCapturer* GetStdoutCapturer() const;
  32. protected:
  33. void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override;
  34. AZ::IO::FixedMaxPath m_configFilePath;
  35. AZ::IO::FileDescriptorCapturer* m_stdoutCapturer;
  36. };
  37. } // namespace AZ::SerializeContextTools