using System.Collections.Generic; using System.IO; namespace SabreTools.FileTypes { /// /// Represents an item that can contain children /// public interface IParent { #region Extraction /// /// Attempt to extract a file as an archive /// /// Output directory for archive extraction /// True if the extraction was a success, false otherwise bool CopyAll(string outDir); /// /// Attempt to extract a file from an archive /// /// Name of the entry to be extracted /// Output directory for archive extraction /// Name of the extracted file, null on error string? CopyToFile(string entryName, string outDir); /// /// Attempt to extract a stream from an archive /// /// Name of the entry to be extracted /// Stream representing the entry, null on error (Stream?, string?) GetEntryStream(string entryName); #endregion #region Information /// /// Generate a list of immediate children from the current folder /// /// List of BaseFile objects representing the found data List? GetChildren(); /// /// Generate a list of empty folders in an archive /// /// Input file to get data from /// List of empty folders in the folder List? GetEmptyFolders(); #endregion #region Writing /// /// Write an input file to an output folder /// /// Input filename to be moved /// Output directory to build to /// BaseFile representing the new information /// True if the write was a success, false otherwise bool Write(string file, string outDir, BaseFile? baseFile); /// /// Write an input stream to an output folder /// /// Input stream to be moved /// Output directory to build to /// BaseFile representing the new information /// True if the write was a success, false otherwise bool Write(Stream? inputStream, string outDir, BaseFile? baseFile); /// /// Write a set of input files to an output folder (assuming the same output archive name) /// /// Input files to be moved /// Output directory to build to /// BaseFiles representing the new information /// True if the inputs were written properly, false otherwise bool Write(List inputFiles, string outDir, List? baseFiles); #endregion } }