// Copyright Epic Games, Inc. All Rights Reserved. using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using EpicGames.Core; using EpicGames.UHT.Types; namespace EpicGames.UHT.Utils { /// /// Delegate invoked by a factory /// /// Invoking factory public delegate void UhtExportTaskDelegate(IUhtExportFactory factory); /// /// Factory object used to generate export tasks /// public interface IUhtExportFactory { /// /// Session being run /// public UhtSession Session { get; } /// /// If this exporter is from a plugin, this points to the module of the plugin /// public UHTManifest.Module? PluginModule { get; } /// /// Create a task /// /// Tasks that must be completed prior to this task running /// Action to be invoked to generate the output(s) /// Task object or null if the task was immediately executed. public Task? CreateTask(List? prereqs, UhtExportTaskDelegate action); /// /// Create a task /// /// Action to be invoked to generate the output(s) /// Task object or null if the task was immediately executed. public Task? CreateTask(UhtExportTaskDelegate action); /// /// Commit the contents of the string builder as the output. /// If you have a string builder, use this method so that a /// temporary buffer can be used. /// /// Destination file path /// Source for the content public void CommitOutput(string filePath, StringBuilder builder); /// /// Commit the value of the string as the output /// /// Destination file path /// Output to commit public void CommitOutput(string filePath, StringView output); /// /// Make a path for an output based on the header file name. /// /// Header file being exported. /// Suffix to be added to the file name. /// Output file path public string MakePath(UhtHeaderFile headerFile, string suffix); /// /// Make a path for an output based on the module name. /// /// Module being exported /// Suffix to be added to the file name. /// Output file path public string MakePath(UhtModule moduleObj, string suffix); /// /// Make a path for the given file name and extension. This is only valid for plugins. /// /// Name of the file /// Extension to add to the file /// Output file path public string MakePath(string fileName, string extension); /// /// Add an external dependency to the given file path /// /// External dependency to add public void AddExternalDependency(string filePath); /// /// Return the shortest relative include path /// /// Module in question /// File path /// Shortest include path relative to the given file path public string GetModuleShortestIncludePath(UhtModule moduleObj, string filePath); /// /// Return the shortest relative include path /// /// File path /// Shortest include path relative to the given file path public string GetPluginShortestIncludePath(string filePath); } }