00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #if !defined(MEMBUFINPUTSOURCE_HPP)
00023 #define MEMBUFINPUTSOURCE_HPP
00024 
00025 #include <xercesc/sax/InputSource.hpp>
00026 
00027 XERCES_CPP_NAMESPACE_BEGIN
00028 
00029 class BinInputStream;
00030 
00031 
00060 class  MemBufInputSource : public InputSource
00061 {
00062 public :
00063     
00064     
00065     
00066 
00069 
00092     MemBufInputSource
00093     (
00094         const   XMLByte* const  srcDocBytes
00095         , const unsigned int    byteCount
00096         , const XMLCh* const    bufId
00097         , const bool            adoptBuffer = false
00098         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00099     );
00100 
00105     MemBufInputSource
00106     (
00107         const   XMLByte* const  srcDocBytes
00108         , const unsigned int    byteCount
00109         , const char* const     bufId
00110         , const bool            adoptBuffer = false
00111         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00112     );
00114 
00121     ~MemBufInputSource();
00123 
00124 
00125     
00126     
00127     
00128 
00131 
00142     BinInputStream* makeStream() const;
00143 
00145 
00146 
00147     
00148     
00149     
00150 
00154 
00170     void setCopyBufToStream(const bool newState);
00171 
00181     void resetMemBufInputSource(const   XMLByte* const  srcDocBytes
00182                                 , const unsigned int    byteCount);
00184 
00185 
00186 private :
00187     
00188     
00189     
00190     MemBufInputSource(const MemBufInputSource&);
00191     MemBufInputSource& operator=(const MemBufInputSource&);
00192 
00193     
00194     
00195     
00196     
00197     
00198     
00199     
00200     
00201     
00202     
00203     
00204     
00205     
00206     
00207     
00208     
00209     
00210     
00211     
00212     
00213     
00214     
00215     bool            fAdopted;
00216     unsigned int    fByteCount;
00217     bool            fCopyBufToStream;
00218     const XMLByte*  fSrcBytes;
00219 };
00220 
00221 
00222 inline void MemBufInputSource::setCopyBufToStream(const bool newState)
00223 {
00224     fCopyBufToStream = newState;
00225 }
00226 
00227 XERCES_CPP_NAMESPACE_END
00228 
00229 #endif