
Hi, I'm working with the boost's IOStream library adding compression/decompression methods others than zip, gzip and bzip2. I'm working too adding support to OLE Compound Documents to the same library, I'd like to "extract" a containt OLE Document using boost::io stream interface. The problem is I'm not sure how to "return or extract" more than one document or compressed file from a stream. All boost examples boost::io::copy() a whole stream to another but not just part of it. I'll appreciate any help, best regards and thank you for such a helpful library Israel

"Israel Fdez. Cabrera" <israel@segurmatica.com> wrote in message news:416D3069.2000407@segurmatica.com...
Hi, I'm working with the boost's IOStream library adding compression/decompression methods others than zip, gzip and bzip2.
Great! Please note that the officially released version will contain some small changes to the interfaces.
I'm working too adding support to OLE Compound Documents to the same library, I'd like to "extract" a containt
contained?
OLE Document using boost::io stream interface. The problem is I'm not sure how to "return or extract" more than one document or compressed file from a stream.
All boost examples boost::io::copy() a whole stream to another but not just part of it. I'll appreciate any help, best regards and thank you for such a helpful
If I understand you correctly, with the current library you need to use the COM interface to get an instance of IStream which can then be easily wrapped as a seekable resource. library I wrote another library with direct support for hierarchical filesystems such as zip files or OLE Compound Documents. A modified version might be a candidate for includion in Boost at some future date. I haven't looked at it in a while, but I believe it supported the following usage: datastream io("ole:C:/file.ole!/directory/hello_word.txt, mode); // Write to the file with path "/directory/hello_world.txt" // in the OLE compound document "C:/file.ole". io << ... You could also create an archive object and iterate through it. archive ar("ole", "C:/file.ole"); for (archive::iterator it = ar.begin(); ... ) ...
Israel
Jonathan --------------------------------------------------------------------------------
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Jonathan Turkanis wrote:
I'm working too adding support to OLE Compound Documents to the same library, I'd like to "extract" a containt
contained?
Yes :) my spelling is not good, sorry!
OLE Document using boost::io stream interface. The problem is I'm not sure how to "return or extract" more than one document or compressed file from a stream.
If I understand you correctly, with the current library you need to use the COM interface to get an instance of IStream which can then be easily wrapped as a seekable resource.
COM? I need my work to compile in POSIX OSs, like Linux, etc and Windows too. More details will be appreciated?
All boost examples boost::io::copy() a whole stream to another but not just part of it. I'll appreciate any help, best regards and thank you for such a helpful
library
I wrote another library with direct support for hierarchical filesystems such as zip files or OLE Compound Documents. A modified version might be a candidate for includion in Boost at some future date. I haven't looked at it in a while, but I believe it supported the following usage:
How can I take a look to this library? any link to dowload will be great!
Israel
Jonathan
best reg@rds Israel

"Israel Fdez. Cabrera" <israel@segurmatica.com> wrote in message news:416D836F.2030209@segurmatica.com...
Jonathan Turkanis wrote:
I'm working too adding support to OLE Compound Documents to the same library, I'd like to "extract" a containt
contained?
Yes :) my spelling is not good, sorry!
No problem -- I just wanted to make sure I was understanding you.
OLE Document using boost::io stream interface. The problem is I'm not sure how to "return or extract" more than one document or compressed file from a stream.
If I understand you correctly, with the current library you need to use the COM interface to get an instance of IStream which can then be easily wrapped as a seekable resource.
COM? I need my work to compile in POSIX OSs, like Linux, etc and Windows too. More details will be appreciated?
I'm not sure I follow. If you have a linux compatible library for reading OLE Compound Documents, there should be some class corresponding to IStream. If you're trying to implement OLE Compound Document support from scratch, it sounds like a big job and I can't help you much. In my experience, microsoft file formats are very poorly documented.
All boost examples boost::io::copy() a whole stream to another but not just part of it. I'll appreciate any help, best regards and thank you for such a helpful
library
I wrote another library with direct support for hierarchical filesystems such as zip files or OLE Compound Documents. A modified version might be a candidate for includion in Boost at some future date. I haven't looked at it in a while, but I believe it supported the following usage:
How can I take a look to this library? any link to dowload will be great!
The library needs to be cleaned up a lot before I can post it. If there is sufficient interest, I'll try to do it, but it would be at least a couple months from now, since I'll be busy trying to get iostreams ready for 1.33. Best Regards, Jonathan

Jonathan Turkanis wrote:
If you're trying to implement OLE Compound Document support from scratch, it sounds like a big job and I can't help you much. In my experience, microsoft file formats are very poorly documented.
I'm not thinking implementing OLE Compound Document support from scratch, it sounds like a big jod, a very big one :). What I'm doing now is part of a biggest project, so I have no time for that.
The library needs to be cleaned up a lot before I can post it. If there is sufficient interest, I'll try to do it, but it would be at least a couple months from now, since I'll be busy trying to get iostreams ready for 1.33.
There is interest in the library, and I'm sure some other have interest too. iostream is a great step ahead in C++, but with this kind of support for compressed, OLE files and maybe more, it will be just fantastic. It is fantastic to compress and decompress file in just 6 lines of code dont you think? :) Let's think I have to use other library, i.e. libgsf from GNU. I have the following doubt. I have a single OLE file, I open() it using a boost::io stream, how more than one stream can be obtained from a single one, taking this OLE file has more than one contained file? The same reasoning could be applied to compressed files. How to extract more than one compressed file using Iostream.
Best Regards, Jonathan
thanks in advance, best regards Israel

"Israel Fdez. Cabrera" <israel@segurmatica.com> wrote in message news:416DA364.2070107@segurmatica.com...
Jonathan Turkanis wrote:
The library needs to be cleaned up a lot before I can post it. If there is sufficient interest, I'll try to do it, but it would be at least a couple months from now, since I'll be busy trying to get iostreams ready for 1.33.
There is interest in the library, and I'm sure some other have interest too. iostream is a great step ahead in C++, but with this kind of support for compressed, OLE files and maybe more, it will be just fantastic. It is fantastic to compress and decompress file in just 6 lines of code dont you think? :)
Yes, but I'm aiming for 4. ;-)
Let's think I have to use other library, i.e. libgsf from GNU. I have the following doubt. I have a single OLE file, I open() it using a boost::io stream, how more than one stream can be obtained from a single one, taking this OLE file has more than one contained file?
For each type of archive (zip, tar, ole) you have to have a module (an 'archive_handler') that knows the format and can extract the information. The appropriate handler is called automatically when someone wants to read an entry for an archive of a particular type. To implement a handler, however, you need to write code which either completely understands the file format in question or delegates that responsibility to an outside library. For OLE compound documents on a windows system, this is simple, since you just use the functions StgOpenStorageEx, IStorage::EnumElements, etc. On Linux, you either have to implement everything yourself, or rely on an existing library. I would assume that such libraries exist. There are also licensing issues to consider. But again, I don't know much about that.
The same reasoning could be applied to compressed files. How to extract more than one compressed file using Iostream.
The zip and tar formats are well-documented and it should be easy to write handlers for them. Let me repeat, though, that this is a separate project, not within the scope of the current library.
Israel
Jonathan

On Thu, 14 Oct 2004 09:25:08 -0600, Jonathan Turkanis wrote
"Israel Fdez. Cabrera" <israel@segurmatica.com> wrote in message news:416DA364.2070107@segurmatica.com...
Jonathan Turkanis wrote:
The library needs to be cleaned up a lot before I can post it. If there is sufficient interest, I'll try to do it, but it would be at least a couple months from now, since I'll be busy trying to get iostreams ready for 1.33.
There is interest in the library, and I'm sure some other have interest too. iostream is a great step ahead in C++, but with this kind of support for compressed, OLE files and maybe more, it will be just fantastic. It is fantastic to compress and decompress file in just 6 lines of code dont you think? :)
Yes, but I'm aiming for 4. ;-)
Let's think I have to use other library, i.e. libgsf from GNU. I have the following doubt. I have a single OLE file, I open() it using a boost::io stream, how more than one stream can be obtained from a single one, taking this OLE file has more than one contained file?
For each type of archive (zip, tar, ole) you have to have a module (an 'archive_handler') that knows the format and can extract the information. The appropriate handler is called automatically when someone wants to read an entry for an archive of a particular type. To implement a handler, however, you need to write code which either completely understands the file format in question or delegates that responsibility to an outside library.
Well, since you guys are thinking down this path, what I've wanted to try is to have these "multi-stream" files export a boost::filesystem directory iterator for the file index and then provide an interface to open an individual 'sub-file' as an fstream. Of course you need the add and remove file interfaces as well to really get control over the archive contents. I think this may have radical impact on boost::filesystem in that this would be a clear case where we want 2 file system implementations available at runtime which is not really supported right now. Jeff

"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20041014161315.M20378@crystalclearsoftware.com...
On Thu, 14 Oct 2004 09:25:08 -0600, Jonathan Turkanis wrote
"Israel Fdez. Cabrera" <israel@segurmatica.com> wrote in message news:416DA364.2070107@segurmatica.com...
Jonathan Turkanis wrote:
Let's think I have to use other library, i.e. libgsf from GNU. I have the following doubt. I have a single OLE file, I open() it using a boost::io stream, how more than one stream can be obtained from a single one, taking this OLE file has more than one contained file?
For each type of archive (zip, tar, ole) you have to have a module (an 'archive_handler') that knows the format and can extract the information. The appropriate handler is called automatically when someone wants to read an entry for an archive of a particular type. To implement a handler, however, you need to write code which either completely understands the file format in question or delegates that responsibility to an outside library.
Well, since you guys are thinking down this path, what I've wanted to try is to have these "multi-stream" files export a boost::filesystem directory iterator for the file index and then provide an interface to open an individual 'sub-file' as an fstream. Of course you need the add and remove file interfaces as well to really get control over the archive contents.
I think this may have radical impact on boost::filesystem in that this would be a clear case where we want 2 file system implementations available at runtime which is not really supported right now.
I'd love to see this too. My library (which in its present form is not nearly as elegant or portable as Boost.Filesystem) is designed to accomodate ordinary filesystems as well as archives. I'm about to leave for the airport, but I'd love to continue this conversation after next week. Best Regards, Jonathan
participants (3)
-
Israel Fdez. Cabrera
-
Jeff Garland
-
Jonathan Turkanis