Utilities.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/Math/Uuid.h>
  10. #include <AzCore/Serialization/ObjectStream.h>
  11. #include <AzCore/std/containers/vector.h>
  12. #include <AzCore/std/string/string.h>
  13. #include <AzCore/std/string/string_view.h>
  14. #include <AzCore/IO/Path/Path_fwd.h>
  15. namespace AZ
  16. {
  17. class SerializeContext;
  18. namespace SerializeContextTools
  19. {
  20. class Application;
  21. class Utilities final
  22. {
  23. public:
  24. static AZStd::string ReadOutputTargetFromCommandLine(Application& application, const char* defaultFileOrFolder = "");
  25. static AZStd::vector<AZStd::string> ReadFileListFromCommandLine(Application& application, AZStd::string_view switchName);
  26. static AZStd::vector<AZStd::string> ExpandFileList(const char* root, const AZStd::vector<AZStd::string_view>& fileList);
  27. static bool HasWildCard(AZStd::string_view string);
  28. static void SanitizeFilePath(AZStd::string& filePath);
  29. static bool IsSerializationPrimitive(const AZ::Uuid& classId);
  30. static AZStd::vector<AZ::Uuid> GetSystemComponents(const Application& application);
  31. //! Converts path into a path that's relative to the highest-priority containing folder
  32. //! (the Assets folder for a Gem or the Projects folder for project's assets)
  33. static AZStd::string GenerateRelativePosixPath(const AZ::IO::PathView& projectPath, const AZ::IO::PathView& absolutePath);
  34. static AZStd::string_view GetStringAfterFirstOccurenceOf(const AZStd::string_view& toFind, const AZStd::string_view& string);
  35. private:
  36. Utilities() = delete;
  37. ~Utilities() = delete;
  38. Utilities(const Utilities&) = delete;
  39. Utilities(Utilities&&) = delete;
  40. Utilities& operator=(const Utilities&) = delete;
  41. Utilities& operator=(Utilities&&) = delete;
  42. };
  43. } // namespace SerializeContextTools
  44. } // namespace AZ