Thanks a lot Jeff!
You really helped me sort this thing out in that attic up in my head.
To summarize it for the audience:
------------------------------------------------
The minimal Filter I can come up with is this:
--
class DoNothingFilter : public Filter
{
public:
DoNothingFilter(BufferedTransformation *attachment) : Filter
(attachment) {}
bool IsolatedFlush(bool hardFlush, bool blocking) { return false; }
size_t Put2(const byte *input, size_t length, int messageEnd, bool
blocking)
{
return AttachedTransformation()->Put2(input, length, messageEnd,
blocking);
}
};
--
I.e., it will transfer all received input and pass it on to the next
BufferedTransformation in the chain.
Any data manipulation will happen before the line:
return AttachedTransformation()->Put2(input, length, messageEnd,
blocking);
(*) The IsolatedFlush() implementation could be replaced by inheriting
from Bufferless< Filter > or Unflushable< Filter >.
The difference between then is beyond me, but the class will be even
more minimal and would look like this:
--
class DoNothingFilter : public Unflushable< Filter >
{
public:
DoNothingFilter(BufferedTransformation *attachment)
{
Detach( attachment );
}
size_t Put2(const byte *input, size_t length, int messageEnd, bool
blocking)
{
return AttachedTransformation()->Put2(input, length, messageEnd,
blocking);
}
};
--
(*) Note the different code in the constructor.
Happy coding!
Avi.
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---