UTF8EncodingOutputStream.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2003-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_UTF8_ENCODING_OUTPUT_STREAM_H
00024 #define _DWFCORE_UTF8_ENCODING_OUTPUT_STREAM_H
00025 
00030 
00031 #include "dwfcore/OutputStream.h"
00032 
00033 
00034 namespace DWFCore
00035 {
00036 
00045 class DWFUTF8EncodingOutputStream : virtual public DWFCoreMemory
00046                                   , public DWFOutputStream
00047 {
00048 
00049 public:
00050 
00063     _DWFCORE_API 
00064     DWFUTF8EncodingOutputStream( DWFOutputStream* pOutputStream = NULL,
00065                                  bool             bOwnStream = false )
00066        throw();
00067 
00073     _DWFCORE_API 
00074     virtual ~DWFUTF8EncodingOutputStream()
00075         throw();
00076 
00080     _DWFCORE_API 
00081     void flush()
00082         throw( DWFException );
00083 
00087     _DWFCORE_API 
00088     virtual size_t write( const void*   pBuffer,
00089                           size_t        nBytesToWrite )
00090         throw( DWFException );
00091 
00099     _DWFCORE_API 
00100     size_t bytes() const
00101         throw();
00102 
00117     _DWFCORE_API 
00118     void attach( DWFOutputStream* pOutputStream,
00119                  bool             bOwnStream )
00120         throw();
00121 
00128     _DWFCORE_API 
00129     void detach()
00130         throw();
00131 
00132 private:
00133 
00134     DWFOutputStream*    _pOutputStream;
00135     bool                _bOwnStream;
00136     size_t              _nBytesEncoded;
00137 
00138     char*               _pBuffer;
00139     size_t              _nBufferBytes;
00140 
00141 private:
00142 
00143     //
00144     // Unimplemented methods
00145     //
00146     DWFUTF8EncodingOutputStream( const DWFUTF8EncodingOutputStream& );
00147     DWFUTF8EncodingOutputStream& operator=( const DWFUTF8EncodingOutputStream& );
00148 };
00149 
00150 }
00151 
00152 
00153 
00154 #endif

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