ProgramFileUtility Class
A few static helper members for System.IO.
Namespace
Songhay
Base Types
  • object
graph BT Type-->Base0["object"] Type["ProgramFileUtility"] class Type type-node

Syntax

public static class ProgramFileUtility

Methods

Name Return Value Summary
CountParentDirectoryChars(string) int
Counts the parent directory chars.
static
FindParentDirectory(string, string, int) string
Finds the parent directory.
static
FindParentDirectoryInfo(string, string, int) DirectoryInfo?
Finds the parent DirectoryInfo.
static
GetCombinedPath(string, string, bool) string
Combines path and root based on the ambient value of Path.DirectorySeparatorChar of the current OS.
static
GetCombinedPath(string, string) string
Combines path and root based on the ambient value of Path.DirectorySeparatorChar of the current OS.
static
GetEncodedString(string, Encoding) string
Gets the encoded string from its default System.Text.Encoding.Unicode encoding.
static
GetEncodedString(string) string
Gets the UTF-8 encoded string from.
static
GetParentDirectory(string, int) string
Gets the parent directory.
static
GetParentDirectoryInfo(string, int) DirectoryInfo?
Gets the parent DirectoryInfo.
static
GetRelativePath(string) string
Gets the relative path from the specified file segment without leading dots (.) or Path.DirectorySeparatorChar chars.
static
IsForwardSlashSystem() bool
Returns true when the current OS uses forward-slash (/) paths or not.
static
NormalizePath(string) string
Normalizes the specified path with respect to the ambient value of Path.DirectorySeparatorChar.
static
ReadZipArchiveEntries(FileInfo?, Action<string>?, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>?) void
Read zip archive entries.
static
ReadZipArchiveEntries(FileInfo?, Action<string>?) void
Read zip archive entries.
static
ReadZipArchiveEntriesByLine(FileInfo?, Action<int, string>?, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>?) void
Read zip archive entries as strings, line by line.
static
ReadZipArchiveEntriesByLine(FileInfo?, Action<int, string>?) void
Read zip archive entries as strings, line by line.
static
RemoveBackslashPrefixes(string) string
Removes conventional Directory prefixes for relative paths, e.g. ..\ or .\
static
RemoveConventionalPrefixes(string) string
Removes conventional Directory prefixes for relative paths based on the ambient value\ of Path.DirectorySeparatorChar.
static
RemoveForwardslashPrefixes(string) string
Removes conventional Directory prefixes for relative paths, e.g. ../ or ./.
static
TrimLeadingDirectorySeparatorChars(string) string
Trims the leading directory separator chars.
static
UseZipArchive(FileInfo?, Action<ZipArchive?>?, ZipArchiveMode) void
Centralizes the use of ZipArchive
static
UseZipArchive(FileInfo?, Action<ZipArchive?>?) void
Centralizes the use of ZipArchive in ZipArchiveMode.Read.
static
UseZipArchiveEntries(FileInfo?, Action<ReadOnlyCollection<ZipArchiveEntry>>?, Func<ReadOnlyCollection<ZipArchiveEntry>, IEnumerable<ZipArchiveEntry>>?) void
Centralizes the use of ReadOnlyCollection<T>.
static
UseZipArchiveEntries(FileInfo?, Action<ReadOnlyCollection<ZipArchiveEntry>>?) void
Centralizes the use of ReadOnlyCollection<T>.
static
WriteZipArchiveEntry(FileInfo?, FileInfo, CompressionLevel) void
Write zip archive entry.
static
WriteZipArchiveEntry(FileInfo?, FileInfo) void
Write zip archive entry with CompressionLevel.Optimal.
static