DigestOutputStream.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_OUTPUT_STREAM_H
00024 #define _DWFCORE_DIGEST_OUTPUT_STREAM_H
00025 
00026 
00031 
00032 #include "dwfcore/Digest.h"
00033 #include "dwfcore/OutputStream.h"
00034 
00035 namespace DWFCore
00036 {
00037 
00048 class DWFDigestOutputStream : virtual public DWFCoreMemory
00049                             , public DWFOutputStream
00050 {
00051 
00052 public:
00053 
00060     _DWFCORE_API
00061     DWFDigestOutputStream()
00062         throw();
00063 
00086     _DWFCORE_API
00087     DWFDigestOutputStream( DWFDigest* pDigest,
00088                            DWFOutputStream* pOutputStream,
00089                            bool bOwnStream )
00090         throw();
00091 
00095     _DWFCORE_API
00096     virtual ~DWFDigestOutputStream()
00097         throw();
00098 
00109     _DWFCORE_API
00110     void setDigest( DWFDigest* pDigest )
00111         throw();
00112 
00131     _DWFCORE_API
00132     virtual void chainOutputStream( DWFOutputStream* pOutputStream,
00133                                     bool             bOwnStream )
00134         throw();
00135 
00146     _DWFCORE_API
00147     virtual bool isDigestProgressive()
00148         throw( DWFException );
00149 
00159     _DWFCORE_API
00160     virtual DWFString digest()
00161         throw( DWFException );
00162 
00163 
00177     _DWFCORE_API
00178     virtual size_t digestRawBytes( unsigned char*& rpBytes )
00179         throw( DWFException );
00180 
00189     _DWFCORE_API
00190     virtual DWFString digestBase64()
00191         throw( DWFException );
00192 
00199     _DWFCORE_API 
00200     virtual void flush()
00201         throw( DWFException );
00202 
00213     _DWFCORE_API
00214     virtual size_t write( const void*   pBuffer,
00215                           size_t        nBytesToWrite )
00216         throw( DWFException );
00217 
00218 private:
00219         
00220     DWFDigest*          _pDigest;
00221 
00222     DWFOutputStream*    _pOutputStream;
00223     bool                _bOwnStream;
00224 
00225 private:
00226 
00227     //
00228     // Unimplemented methods
00229     //
00230 
00231     DWFDigestOutputStream( const DWFDigestOutputStream& );
00232     DWFDigestOutputStream& operator=( const DWFDigestOutputStream& );
00233 
00234 };
00235 
00236 }
00237 
00238 #endif
00239 
00240 

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