/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include #include namespace AZ { class CommandLine; class Entity; class ModuleEntity; class SerializeContext; struct Uuid; namespace SerializeContextTools { class Application; class Converter { public: static bool ConvertObjectStreamFiles(Application& application); //! Converts Windows INI Style File //! Can be used to convert *.ini and *.cfg files static bool ConvertConfigFile(Application& application); protected: using PathDocumentPair = AZStd::pair; using PathDocumentContainer = AZStd::vector; static bool VerifyConvertedData(rapidjson::Value& convertedData, const void* original, const Uuid& originalType, const JsonDeserializerSettings& settings); static AZStd::string GetClassName(const Uuid& classId, SerializeContext* context); static bool WriteDocumentToDisk(const AZStd::string& filename, const rapidjson::Document& document, AZStd::string_view documentRoot, rapidjson::StringBuffer& scratchBuffer); static void SetupLogging(AZStd::string& scratchBuffer, JsonSerializationResult::JsonIssueCallback& callback, const AZ::CommandLine& commandLine); static JsonSerializationResult::ResultCode VerboseLogging(AZStd::string& scratchBuffer, AZStd::string_view message, JsonSerializationResult::ResultCode result, AZStd::string_view target); static AZ::JsonSerializationResult::ResultCode SimpleLogging(AZStd::string& scratchBuffer, AZStd::string_view message, JsonSerializationResult::ResultCode result, AZStd::string_view target); }; } // namespace SerializeContextTools } // namespace AZ