[sword-devel] NEED A HAND
Terry Biggs
sword-devel@crosswire.org
20 Feb 2003 11:22:37 -0500
Troy.
What do I do with this?
if (*((*buf)-1) == '/')
I'm working on thmlhtmlhref
On Thu, 2003-02-20 at 02:46, Troy A. Griffitts wrote:
> Hey guys. I just added the new SWBuf class to the API and now need help
> integrating it throughout.
>
> CURRENT CVS IS BROKEN AND WON'T WORK TILL THIS IS DONE.
>
> I was going to do it all myself, but realized that we have nearly 50
> filters now!
>
> SO, if you have cvs write access, please post a note claiming a few
> filter that you are working on so we don't overlap our work.
>
>
> Here is the gist...
>
> SWBuf works pretty much like string, except that it can operate on
> buffers that aren't null terminated, as well.
>
> Have a look at tests/swbuftest.cpp and include/swbuf.h
>
> Up until yesterday there was a FILTER_PAD define that basically told us
> how much to guess at allocating a buffer to be sure we had enough space
> for filter to do their job. The filters used to take a char *.
>
> Now, FILTER_PAD is gone (hurray!) and we're passing SWBuf & in place of
> char * to the filters.
>
> Headers have been changed to reflect the new sigs, but the .cpp files
> have not.
>
> swbasicfilter.cpp and gbfhtml.cpp are done.
>
> Quick help:
>
> -char Filter::ProcessText(char *text, int maxlen, const SWKey *key,
> - const SWModule *module)
> +char Filter::processText(SWBuf &text, const SWKey *key,
> + const SWModule *module)
>
>
> - pushString(buf, "whatever");
> + buf += "whatever";
>
>
> - *(*buf)++ = 'x';
> + buf += 'x';
>
>
> - pushString(buf, "%d %s", 4, "cows");
> + buf.appendFormatted("%d %s", 4, "cows");
>
>
> - char *to, *from;
> - len = strlen(text) + 1;
>
> - // shift string to right of buffer
> - if (len < maxlen) {
> - memmove(&text[maxlen - len], text, len);
> - from = (unsigned char *)&text[maxlen - len];
> - }
> - else from = (unsigned char *)text;
> - for (to = (unsigned char *)text; *from; from++) {
> + const char *from;
> + SWBuf orig = text;
> + from = orig.c_str();
> + for (text = ""; *from; from++) {
>
> _______________________________________
>
> Thanks for considering helping on this one!
>
> In His Grace,
> -Troy.
>
>
> _______________________________________________
> sword-devel mailing list
> sword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
--
Terry <tbiggs@users.sf.net>
Rev 1:5 And from Jesus Christ, who is the faithful witness, and the first begotten of the dead, and the prince of the kings of the earth. Unto him that loved us, and washed us from our sins in his own blood
http://gnomesword.sf.net