using System; using System.Collections.Generic; using System.Text; namespace ICSharpCode.SharpZipLib.Zip { /// /// General ZipEntry helper extensions /// public static class ZipEntryExtensions { /// /// Efficiently check if a flag is set without enum un-/boxing /// /// /// /// Returns whether the flag was set public static bool HasFlag(this ZipEntry entry, GeneralBitFlags flag) => (entry.Flags & (int) flag) != 0; /// /// Efficiently set a flag without enum un-/boxing /// /// /// /// Whether the passed flag should be set (1) or cleared (0) public static void SetFlag(this ZipEntry entry, GeneralBitFlags flag, bool enabled = true) => entry.Flags = enabled ? entry.Flags | (int) flag : entry.Flags & ~(int) flag; } }