COM Structured Storage
This article includes a list of general references, but it lacks sufficient corresponding inline citations. (September 2009) |
COM Structured Storage (variously also known as
Structured storage is widely used in
Motivation
Structured storage addresses some inherent difficulties of storing multiple data objects within a single file. One difficulty arises when an object persisted in the file changes in size due to an update. If the application that is reading/writing the file expects the objects in the file to remain in a certain order, everything following that object's representation in the file may need to be shifted backward to make room if the object grows, or forward to fill in the space left over if the object shrinks. If the file is large, this could result in a costly operation. Of course, there are many possible solutions to this difficulty, but often the application programmer does not want to deal with low level details such as binary file formats.
Structured storage provides an abstraction known as a stream, represented by the interface IStream
. A stream is conceptually very similar to a file, and the IStream
interface provides methods for reading and writing similar to file input/output. A stream could reside in
If an application wishes to persist several data objects to a file, one way to do so would be to open an IStorage
that represents the contents of that file and save each of the objects within a single IStream
. One way to accomplish the latter is through the standard COM interface IPersistStream
. OLE depends heavily on this model to embed objects within documents.
Format
Microsoft's implementation uses a file format known as compound files, and all of the widely deployed structured storage implementations read and write this format. Compound files use a
The following applications use the OLE Structured Storage (Compound Document Format)
- 2003documents:
- Word documents (.DOC, .DOT)
- Excel spreadsheets (.XLS, .XLT)
- PowerPoint presentations (.PPT, .POT)
- Publisher files (.PUB)
- Visio files (.VSD)
- Project files (.MPP)
- Microsoft PhotoDraw files (.MIX)
- Microsoft Outlook files (.MSG)
- Windows Installer files (.MSI, .MSP, .MST)
- Microsoft Picture It! / Microsoft Digital Image files (.MIX)
- Internet Explorer RSS Feeds Windows RSS Platform files (.feed-ms)
- Windows 7 StickyNotes (.SNT)
- Windows 7 jumplists files
- Thumbs.db
- Microsoft SQL 2000 Server DTS packages
- Autodesk Revit
- Autodesk Inventor
- FlashPix
- Altium Designer
Native Structured Storage
During the
Implementations
- For Microsoft .NET:
- OpenMCDF – Free .NET component for accessing OLE structured storage files, MPL licensed.
- For Linux:
- GNOME Structured File Library – Can read Microsoft structured storage files.
- POLE.
- Cross platform C++ for Window/MacOSX/Linux:
- For Java:
- POIFS – Java implementation of the OLE 2 Compound Document format, part of Apache POI.
- For Perl:
- For JavaScript:
- js-cfb – JavaScript implementation of the OLE 2 Compound Document format.
- For Python:
- compoundfiles – Python implementation of the Microsoft Compound File Binary (CFB) format.
References
- ^ "What is Native Structured Storage?". Archived from the original on 2007-09-27. Retrieved 2007-12-03.