DigestInputStream.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
00008 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00009 //  WORKS WHICH INCORPORATE IT.
00010 //
00011 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00012 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00013 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00014 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00015 //
00016 //  Use, duplication, or disclosure by the U.S. Government is subject to
00017 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00018 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00019 //  Data and Computer Software), as applicable.
00020 //
00021 
00022 
00023 #ifndef _DWFCORE_DIGEST_INPUT_STREAM_H
00024 #define _DWFCORE_DIGEST_INPUT_STREAM_H
00025 
00026 
00031 
00032 #include "dwfcore/Digest.h"
00033 #include "dwfcore/InputStream.h"
00034 
00035 namespace DWFCore
00036 {
00037 
00048 class DWFDigestInputStream : virtual public DWFCoreMemory
00049                            , public DWFInputStream
00050 {
00051 
00052 public:
00053 
00060     _DWFCORE_API
00061     DWFDigestInputStream()
00062         throw();
00063 
00086     _DWFCORE_API
00087     DWFDigestInputStream( DWFDigest* pDigest,
00088                           DWFInputStream* pInputStream,
00089                           bool bOwnStream )
00090         throw();
00091 
00095     _DWFCORE_API
00096     virtual ~DWFDigestInputStream()
00097         throw();
00098 
00109     _DWFCORE_API
00110     void setDigest( DWFDigest* pDigest )
00111         throw();
00112 
00131     _DWFCORE_API
00132     virtual void chainInputStream( DWFInputStream* pInputStream,
00133                                    bool            bOwnStream )
00134         throw();
00135 
00146     _DWFCORE_API
00147     virtual bool isDigestProgressive()
00148         throw( DWFException );
00149 
00158     _DWFCORE_API
00159     virtual DWFString digest()
00160         throw( DWFException );
00161 
00175     _DWFCORE_API
00176     virtual size_t digestRawBytes( unsigned char*& rpBytes )
00177         throw( DWFException );
00178 
00187     _DWFCORE_API
00188     virtual DWFString digestBase64()
00189         throw( DWFException );
00190 
00199     _DWFCORE_API
00200     virtual size_t available() const
00201         throw( DWFException )
00202     {
00203         return (_pInputStream == NULL) ? 0 : _pInputStream->available();
00204     }
00205 
00220     _DWFCORE_API
00221     virtual size_t read( void*  pBuffer,
00222                          size_t nBytesToRead )
00223         throw( DWFException );
00224 
00239     _DWFCORE_API
00240     virtual off_t seek( int     eOrigin,
00241                         off_t   nOffset )
00242         throw( DWFException );
00243 
00244 private:
00245 
00246     DWFDigest*      _pDigest;
00247 
00248     DWFInputStream* _pInputStream;
00249     bool            _bOwnStream;
00250 
00251 private:
00252 
00253     //
00254     // Unimplemented methods
00255     //
00256 
00257     DWFDigestInputStream( const DWFDigestInputStream& );
00258     DWFDigestInputStream& operator=( const DWFDigestInputStream& );
00259 };
00260 
00261 }
00262 
00263 
00264 
00265 #endif
00266 
00267 

Generated on Tue Jan 6 22:39:28 2009 for Autodesk DWF Core Library by  doxygen 1.4.5