I have huge lack of understanding source/filters/sink concept. I want
to parse xml file from crypto filters.
libxml2 has a function to parse an input from callback-based stream. It
looks like:

int callbackFunc(void *context, const char *buffer, int len)
{
// function must read a data, put it in the buffer (not more than len
bytes) and return real amount of read bytes.
// at the end of the stream it must return 0
// -1 for error indication.
}

then I call library function:

xmlDocPtr = xmlReadIO(..., callbackFunc, context, ...);

The library invokes the callback as it wants.
I want to feed a data from crypto++.
If I use just FileSource as source object, it work fine. Something like
this:

int callbackFunc(void *context, const char *buffer, int len)
{
 FileSource * source  = (FileSource *)context;
 source->Pump(len);
 return source->Get(buffer, len);
}
...
FileSource source("a file");
xmlDocPtr = xmlReadIO(..., callbackFunc, &source, ...);

But if I try to use filters (e.g. encryption+compression) this method
doesn't work, because I don't know how much I have to Pump, without
pumping Get doesn't give any data.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to