![]() |
Desktop Development »
Files and Folders »
General
Intermediate
Structured Storage - The DocFileBy Andrew PeaceA wrapper class for easy use of OLE structured storage. |
VC6, MFC, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
Structured storage is something which, when done using the plain Windows API, seems overly complicated; much more so than is needed. The aim of this article is to briefly introduce you to the concepts behind structured storage, and then provide a helper class to simplify its usage.
The idea behind structured storage is that a single file can itself contain a basic filing system. Its main reason for existence was to help with OLE documents: embedded objects are simply save as separate 'streams' within the single file. Here is a diagram which illustrates this concept:
| STRUCTURED STORAGE FILE |
|
Although this technology is primarily for use in OLE, it can be put to other uses. In order to help you access the functionality of this powerful tool easily, I have created a helper class, namely CSSFile, to aid in the creation, and modification of structured storage files.
If you have used this class previously, you will most likely wish to update your code to use the latest version. Here are the main differences (note that the interface remains the same):
Whilst the class is fairly straightforward, I have listed the functions and their interfaces below to aid your usage of the class:
filename - the name of the file to be created
mode - the mode of access for the file
'true' if the file was successfully created
filename - the name of the file to open
mode - the mode of access for the file
'true' if the file was successfully opened
pNews - the storage this object should hook
The previous storage being managed by the object
The previous storage being managed by the object
name - the name of the storage to create (will be created within the current path inside the root storage)
enter - enter the storage after creation?
mode - the mode of access for the storage
'true' if the storage was successfully created
name - the name of the storage to open
mode - the mode of access for the storage
'true' if the storage was successfully opened
'true' if the storage path was moved up a level
name - the name of the stream to create
sf - a COleStreamFile into which the stream is opened
mode - the mode of access for the stream
'true' if the stream was successfully created
name - the name of the stream to open
sf - a COleStreamFile into which the stream is opened
mode - the mode of access for the stream
'true' if the stream was successfully opened
name - the name of the element to destroy
'true' if the element was successfully destroyed
The root of the currently open storage
The currently open storage
Whether a file is currently being managed by the object
The filename of the root storage
SepChar - the character to be used to separate the paths in the storages (i.e. Windows uses '\' for standard file system paths).
The current path within the storage (including the filename of the root storage).
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 14 Jul 2001 Editor: Chris Maunder |
Copyright 2000 by Andrew Peace Everything else Copyright © CodeProject, 1999-2009 Web22 | Advertise on the Code Project |