Class FileInfoExtensions
- Namespace
- Songhay.Extensions
- Assembly
- SonghayCore.dll
Extension of FileInfo
public static class FileInfoExtensions
- Inheritance
-
FileInfoExtensions
- Inherited Members
Methods
ReadZipArchiveEntries(FileInfo, Action<string>)
Read zip archive entries.
public static void ReadZipArchiveEntries(this FileInfo archiveInfo, Action<string> fileAction)
Parameters
Remarks
Use entriesProjector
for any filtering or sorting.
ReadZipArchiveEntries(FileInfo, Action<string>, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>)
Read zip archive entries.
public static void ReadZipArchiveEntries(this FileInfo archiveInfo, Action<string> fileAction, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>> entriesProjector)
Parameters
archiveInfo
FileInfoThe FileInfo.
fileAction
Action<string>The file action.
entriesProjector
Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>The entries projector.
Remarks
Use entriesProjector
for any filtering or sorting.
ReadZipArchiveEntriesByLine(FileInfo, Action<int, string>)
Read zip archive entries as strings, line by line.
public static void ReadZipArchiveEntriesByLine(this FileInfo archiveInfo, Action<int, string> lineAction)
Parameters
archiveInfo
FileInfoThe file and/or directory info.
lineAction
Action<int, string>The line action.
Remarks
This member is designed for compressed text documents that are too large to load into memory.
The fileAction
includes the line number and the current line.
ReadZipArchiveEntriesByLine(FileInfo, Action<int, string>, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>)
Read zip archive entries as strings, line by line.
public static void ReadZipArchiveEntriesByLine(this FileInfo archiveInfo, Action<int, string> lineAction, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>> entriesProjector)
Parameters
archiveInfo
FileInfoThe file and/or directory info.
lineAction
Action<int, string>The line action.
entriesProjector
Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>The filter zip archive entries.
Remarks
This member is designed for compressed text documents that are too large to load into memory.
The fileAction
includes the line number and the current line.
UseZipArchive(FileInfo, Action<ZipArchive?>)
Centralizes the use of ZipArchive
public static void UseZipArchive(this FileInfo archiveInfo, Action<ZipArchive?> archiveAction)
Parameters
archiveInfo
FileInfoarchiveAction
Action<ZipArchive>
UseZipArchiveEntries(FileInfo, Action<ReadOnlyCollection<ZipArchiveEntry>>)
Centralizes the use of ReadOnlyCollection<T>.
public static void UseZipArchiveEntries(this FileInfo archiveInfo, Action<ReadOnlyCollection<ZipArchiveEntry>> entriesAction)
Parameters
archiveInfo
FileInfoentriesAction
Action<ReadOnlyCollection<ZipArchiveEntry>>
UseZipArchiveEntries(FileInfo, Action<ReadOnlyCollection<ZipArchiveEntry>>, Func<ReadOnlyCollection<ZipArchiveEntry>, ReadOnlyCollection<ZipArchiveEntry>>)
Centralizes the use of ReadOnlyCollection<T>.
public static void UseZipArchiveEntries(this FileInfo archiveInfo, Action<ReadOnlyCollection<ZipArchiveEntry>> entriesAction, Func<ReadOnlyCollection<ZipArchiveEntry>, ReadOnlyCollection<ZipArchiveEntry>> entriesProjector)
Parameters
archiveInfo
FileInfoentriesAction
Action<ReadOnlyCollection<ZipArchiveEntry>>entriesProjector
Func<ReadOnlyCollection<ZipArchiveEntry>, ReadOnlyCollection<ZipArchiveEntry>>
WriteZipArchiveEntry(FileInfo, FileInfo)
Write zip archive entry with Optimal.
public static void WriteZipArchiveEntry(this FileInfo archiveInfo, FileInfo fileInfo)
Parameters
WriteZipArchiveEntry(FileInfo, FileInfo, CompressionLevel)
Write zip archive entry.
public static void WriteZipArchiveEntry(this FileInfo archiveInfo, FileInfo fileInfo, CompressionLevel compressionLevel)
Parameters
archiveInfo
FileInfoThe file and/or directory info.
fileInfo
FileInfoThe file information.
compressionLevel
CompressionLevelThe CompressionLevel