Tuesday, May 6, 2008

Structured Storage

I have got through the first set of utilities and have started on the nitty-gritty of the file operations. A first look at a file called DWEditFile it seems like Cello uses Structured Storage. Coming from OSX this was the first time I have come across this technology, which is proprietary to Microsoft, and not available under OSX.

Usefull Liks:
  1. Mictosoft's Structured Storage Reference
  2. An Introduction to Structured Storage

There are a couple of open source projects that will read and write Structured Storage documents.
  1. GNOME - Structured File Library (GPL)
  2. POLE - Portable C++ library to access OLE Storage (BSD)

POLE seems to very lightweight, and straight forward. Looking through the code, on the surface, it lacks:
  1. Some exception handling.
  2. A copy operation - for copying bits of one document into another. This is something that Cello uses.
Neither of these seem that difficult to implement. The trick to it would seem to build a test bed to create and test the document - including the new copy operation.

The final thing that is different is that the way of accessing different parts of the document (structured documents are hierarchical) using POLE is very different to the windows. MFC seems to have iterators that will iterate through a given part of the document structure. I wonder if the best way to deal with this would to build an iterator like the MFC one on top of POLE - which minimizes the changes that will need to be made to to Cello. Also I can write a separate test code for this.

After doing the easy part of deploying POLE I had some problems understanding how the existing code worked and how to port it onto POLE. Strangely the DWEditFile is not the main document file (a bad assumption on my part) - the thing now is to figure out where it is used. It could be a skeleton.

No comments: