// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include #include #include namespace zen::horde { /** Describes a file to include in a Horde bundle. */ struct BundleFile { std::filesystem::path Path; ///< Local file path bool Optional; ///< If true, skip without error if missing }; /** Result of a successful bundle creation. */ struct BundleResult { std::string Locator; ///< Root directory locator for WriteFiles std::filesystem::path BundleDir; ///< Directory containing .blob files }; /** Creates Horde V2 bundles from local files for upload to remote agents. * * Produces a proper Horde storage V2 bundle containing: * - Chunk leaf exports for file data (split into 64KB chunks for large files) * - Optional interior chunk nodes referencing leaf chunks * - A directory node listing all bundled files with metadata * * The bundle is written as a single .blob file with a corresponding .ref file * containing the locator string. The locator format is: * #pkt=0,&exp= */ struct BundleCreator { /** Create a V2 bundle from one or more input files. * @param Files Files to include in the bundle. * @param OutputDir Directory where .blob and .ref files will be written. * @param OutResult Receives the locator and output directory on success. * @return True on success. */ static bool CreateBundle(const std::vector& Files, const std::filesystem::path& OutputDir, BundleResult& OutResult); /** Read a locator string from a .ref file. Strips trailing whitespace/newlines. */ static bool ReadLocator(const std::filesystem::path& RefFile, std::string& OutLocator); }; } // namespace zen::horde