Application.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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(int argc, char** argv, ComponentApplicationSettings componentAppSettings);
  24. Application(int argc, char** argv, AZ::IO::FileDescriptorCapturer* stdoutCapturer, ComponentApplicationSettings componentAppSettings);
  25. ~Application() override = default;
  26. const char* GetConfigFilePath() const;
  27. AZ::ComponentTypeList GetRequiredSystemComponents() const override;
  28. void QueryApplicationType(AZ::ApplicationTypeQuery& appType) const override;
  29. //! Associates a FileDescriptorCapturer with the SerializeContextApplication that
  30. //! redirects stdout to a visitor callback.
  31. //! The FileDescriptorCapturer supports a write bypass to force writing to stdout if need be
  32. void SetStdoutCapturer(AZ::IO::FileDescriptorCapturer* stdoutCapturer);
  33. AZ::IO::FileDescriptorCapturer* GetStdoutCapturer() const;
  34. protected:
  35. void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override;
  36. AZ::IO::FixedMaxPath m_configFilePath;
  37. AZ::IO::FileDescriptorCapturer* m_stdoutCapturer;
  38. };
  39. } // namespace AZ::SerializeContextTools