[sword-devel] Working on a STEP Reader for SWORD

Troy A. Griffitts sword-devel@crosswire.org
Tue, 20 Jun 2000 13:02:39 -0700


Steve,
	Sorry for not doc'ing the code better.

	Buf and zBuf are both getters and setters

	c.Buf();	// retrieves the contents of the object uncompressed
	c.Buf(someBuffer); 	// sets the contents of the object with
uncompressed information
	c.zBuf();	// retrieves the contents of the object compressed
	c.zBuf(someBuffer);	// sets the contents of the object with compressed
information


To uncompress:

	c.zBuf(someSTEPblock);
	cout << c.Buf();


	Hope this helps.


"Trandahl, Steve" wrote:
> 
> This is stretching my rusty C++ skills.  If I am reading the code correctly,
> calling the zBuf method suggested below will compress the text into the
> compressed buffer.  However, the text I'm reading from the STEP files is
> already compressed.  I guess I want to put the text directly into the
> compressed buffer without altering it.
> 
> Are there any suggestions as to how to set this up?  I thought about
> overriding the zBuf method to skip the compression, but then there would be
> no way to compress using this class.
> 
> Thanks,
> Steve
> 
> -----Original Message-----
> From: Troy A. Griffitts [mailto:scribe@crosswire.org]
> Sent: Friday, June 02, 2000 8:10 PM
> To: sword-devel@crosswire.org
> Subject: Re: [sword-devel] Working on a STEP Reader for SWORD
> 
> Steve,
>         It's not a bad as others might suggest.  We do have STEP
> decompression
> classes.  You will find them under
> sword/src/modules/common/lzsscomprs.cpp
> 
> a convoluted example of using this class can be found in
> sword/tests/complzss
> 
> A you will probably use the buffer methods to send chunks of a STEP
> module for decompression, eg.
> 
> // set compressed buffer to the lzss compression class
> compress.zBuf(blockSize, compressedBuf);
> 
> // ask the compression class for the decompressed buffer
> cout << "Decompressed text: " << compress.Buf();
> 
> Hope this gives ya a start.  The STEP spec will tell you that umpteen
> bytes at the beginning of the index files tell you meta data and then
> you'll start getting to real data blocks eventually.  Try sending one of
> these data blocks to the compress class and you should get plain text
> data back (well STEP's RTF+ markup with data).  You will then want to
> visit our filter collection:
> 
> sword/src/modules/filters/
> 
> These filters are used for parsing different markup methodologies.  We
> have some for rtf, gbf, html, etc.  You might be able to start with one
> of these and see if you can get some basic text to display.
> 
>         Please feel free to ASK LOTS OF QUESTIONS! :)
> 
>                         -Troy.
> 
> "Trandahl, Steve" wrote:
> >
> > I would like to create a module for Sword that would allow it to read
> books
> > in the STEP format.  I understand that there has been some work done, but
> > that no one is currently working on it.  How do I locate the existing
> source
> > code for it?
> >
> >
> > Steve Trandahl
> > Cotelligent Philadelphia
> >  <mailto:Steve.Trandahl@Cotelligent.com> Steve.Trandahl@Cotelligent.com
> >
> >