Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Microsoft Compound File .net component - pure C# - netstandard 2.0

License

NotificationsYou must be signed in to change notification settings

ironfede/openmcdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub ActionsCodeQLOpenMcdf NuGetOpenMcdf.Ole NuGetNuGet Downloads

OpenMcdf

OpenMcdf is a fully .NET / C# library to manipulateCompound File Binary File Format files, also known asStructured Storage.

Compound files include multiple streams of information (document summary, user data) in a single container, and is used as the bases for many different file formats:

  • Microsoft Office (.doc, .xls, .ppt)
  • Windows thumbnails cache files (thumbs.db)
  • Outlook messages (.msg)
  • Visual Studio Solution Options (.suo)
  • Advanced Authoring Format (.aaf)

OpenMcdf v3 has a rewritten API and supports:

  • An idiomatic dotnet API and exception hierarchy
  • Fast and efficient enumeration and manipulation of storages and streams
  • File sizes up to 16 TB (using major format version 4 with 4096 byte sectors)
  • Transactions (i.e. commit and/or revert)
  • Consolidation (i.e. reclamation of space by removing free sectors)
  • Nullable attributes

Limitations:

  • No support for red-black tree balancing (directory entries are stored in a tree, but are not balanced. i.e. trees are "all-black")
  • No support for single writer, multiple readers

Getting started

To create a new compound file:

byte[]b=newbyte[10000];usingvarroot=RootStorage.Create("test.cfb");usingCfbStreamstream=root.CreateStream("MyStream");stream.Write(b,0,b.Length);

To open an Excel workbook (.xls) and access its main data stream:

usingvarroot=RootStorage.OpenRead("report.xls");usingCfbStreamworkbookStream=root.OpenStream("Workbook");

To create or delete storages and streams:

usingvarroot=RootStorage.Create("test.cfb");root.CreateStorage("MyStorage");root.CreateStream("MyStream");root.Delete("MyStream");

For transacted storages, changes can either be committed or reverted:

usingvarroot=RootStorage.Create("test.cfb",StorageModeFlags.Transacted);root.Commit();//root.Revert();

A root storage can be consolidated to reduce its on-disk size:

root.Flush(consolidate:true);

Object Linking and Embedding (OLE) Property Set Data Structures

Support for reading and writingOLE Properties is available via theOpenMcdf.Ole package. However,the API is experimental and subject to change.

OlePropertiesContainerco=new(stream);foreach(OlePropertypropinco.Properties){  ...}

OpenMcdf runs happily on theMono platform and multi-targetsnetstandard2.0 andnet8.0 to maximize client compatibility and support modern dotnet features.

About

Microsoft Compound File .net component - pure C# - netstandard 2.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp