On Monday, May 19, 2014 2:36:34 AM UTC-4, John Wiseman wrote:

>   I'm trying to make a custome source similar to the FileSource. But 
> failed to figure out what FileStore::TransferTo2()/CopyRangeTo2() and 
> FilterPutSpaceHelper actually do.
>
A Source is a Filter. If interested, see 
http://www.cryptopp.com/wiki/Filter and 
http://www.cryptopp.com/wiki/Filter_(Intermediate).

TransferTo and TransferTo2 allow you to move bytes from one object to 
another. The bytes are removed from the source object, and delivered to the 
destination object.

CopyTo, CopyRangeTo, and CopyRangeTo2 allow you to copy bytes from one 
object to another. The bytes are not removed from the source object.

I don't think I've ever used FilterPutSpaceHelper. I think its used to 
create a scratch space in the attached transformation. Its used in a few 
places in the library. See 
http://www.cryptopp.com/docs/ref/struct_filter_put_space_helper.html.

I believe the only thing you *must* implement is Put2. Even then, it 
usually calls Put2 on its attached transformation. Something like:

  class UselessFilter : public Filter
  {
  public:
      UselessFilter(BufferedTransformation* attachment = NULL)
          : Filter(attachment) { };

      size_t Put2(const byte * inString,
          size_t length, int messageEnd, bool blocking )
      {
          return AttachedTransformation()->Put2(
              inString, length, messageEnd, blocking );
      }
  };

Jeff

-- 
-- 
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.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to