HI Alan,

Using osgDB in this way is new area for me so I don't have any solid
suggestions.  One thing you could explore is pre loading a plugin that
implements the archive support as you need, this could allow you to
provide your own archive plugin.

However, this doesn't directly solve the problem you have - inserting
the streambuffer after the archives stream buf.  Perhaps this could be
done by some mechansim in osgDB that allow to you to intercept normal
ReaderWriter::readNode(istream) calls and adapt it yourself.  There is
an osgDB::Registry::ReadFileCallback right now, but this doesn't catch
istream calls, so perhaps a ReadIstreamCallback is required, this way
you could itercept the istream and rewrire up new one with your own
decryption codes.

I think the later route is the way to go as this would allow you to
work with other plugins that the osga one.  A WriteOstreamCallback of
some form might also be appropriate.

Robert.

On 2/19/07, Alan Harris <[EMAIL PROTECTED]> wrote:
Robert

A few weeks ago there was a short discusion about encryption. I have
implemented a method and a couple of points arose that are worth passing on.

I am only interested in the encrypting the archive files which contain
the landscape and therefore decided that using OSGA_Archive was a
reasonable starting point as I could see where to intercept the read and
write.

Initially I created a new file plugin similar to OSGA_Archive but using
a different file qualifier than "osga". This hit a road block because in
osgDB::Registry.cpp function read() ".osga" is hardcoded as achiveName.
I could not see any easy way round this (I may have missed something
obvious). Having a means to set this archive name qualifier in Registry
would be useful (to me at least). Does this make sense?

Secondly, I reverted to modifying OSGA_Archive, and, in order to
intercept the read and write within OSGA_Archive, created read and write
callbacks based on streambuf. These effectively allow encryption or
compression for example from a calling program.

This leads me to 2 questions: 1) is the addition of callbacks of any
interest to the community and 2) if it is, would they be better
implemented within the Archive class so that any derived archive could
have the facility.

If any of these are yes I will create a submission.

--

Regards
Alan Harris

ReSoft Ltd
Cornwallis, Burycroft Road
Hook Norton
Banbury, OX15 5PR, UK
Tel: +44 (0) 1608 730707
Email: [EMAIL PROTECTED]
Web: www.resoft.co.uk
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to