Add Compound File Binary (CFB) archive support

Introduces CompoundInfoPanel for viewing Compound File Binary archives (.cfb, .eif) in the ArchiveViewer plugin. Updates Plugin.cs to detect and use the new panel for these file types, enabling preview and information display for CFB-based archives.
This commit is contained in:
ema
2025-12-26 01:05:52 +08:00
parent 19805f06c5
commit 36d2d44200
3 changed files with 242 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
using QuickLook.Common.Plugin;
using QuickLook.Plugin.ArchiveViewer.ArchiveFile;
using QuickLook.Plugin.ArchiveViewer.CompoundFileBinary;
using System;
using System.IO;
using System.Linq;
@@ -50,8 +51,8 @@ public class Plugin : IViewer
".zip", // ZIP compressed archive (most common compression format)
// List of supported compound file binary file extensions
//".cfb", // Compound File Binary format (used by older Microsoft Office files)
//".eif", // QQ emoji file (Compound File Binary format)
".cfb", // Compound File Binary format (used by older Microsoft Office files)
".eif", // QQ emoji file (Compound File Binary format)
];
private IDisposable _panel;
@@ -74,7 +75,15 @@ public class Plugin : IViewer
public void View(string path, ContextObject context)
{
_panel = new ArchiveInfoPanel(path);
if (path.EndsWith(".cfb", StringComparison.OrdinalIgnoreCase)
|| path.EndsWith(".eif", StringComparison.OrdinalIgnoreCase))
{
_panel = new CompoundInfoPanel(path);
}
else
{
_panel = new ArchiveInfoPanel(path);
}
context.ViewerContent = _panel;
context.Title = $"{Path.GetFileName(path)}";