00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 #if !defined(MEMBUFINPUTSOURCE_HPP)
00109 #define MEMBUFINPUTSOURCE_HPP
00110 
00111 #include <xercesc/sax/InputSource.hpp>
00112 
00113 XERCES_CPP_NAMESPACE_BEGIN
00114 
00115 class BinInputStream;
00116 
00117 
00146 class  MemBufInputSource : public InputSource
00147 {
00148 public :
00149     
00150     
00151     
00152 
00155 
00177     MemBufInputSource
00178     (
00179         const   XMLByte* const  srcDocBytes
00180         , const unsigned int    byteCount
00181         , const XMLCh* const    bufId
00182         , const bool            adoptBuffer = false
00183         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00184     );
00185 
00190     MemBufInputSource
00191     (
00192         const   XMLByte* const  srcDocBytes
00193         , const unsigned int    byteCount
00194         , const char* const     bufId
00195         , const bool            adoptBuffer = false
00196         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00197     );
00199 
00206     ~MemBufInputSource();
00208 
00209 
00210     
00211     
00212     
00213 
00216 
00227     BinInputStream* makeStream() const;
00228 
00230 
00231 
00232     
00233     
00234     
00235 
00239 
00255     void setCopyBufToStream(const bool newState);
00256 
00258 
00259 
00260 private :
00261     
00262     
00263     
00264     MemBufInputSource(const MemBufInputSource&);
00265     MemBufInputSource& operator=(const MemBufInputSource&);
00266 
00267     
00268     
00269     
00270     
00271     
00272     
00273     
00274     
00275     
00276     
00277     
00278     
00279     
00280     
00281     
00282     
00283     
00284     
00285     
00286     
00287     
00288     
00289     bool            fAdopted;
00290     unsigned int    fByteCount;
00291     bool            fCopyBufToStream;
00292     const XMLByte*  fSrcBytes;
00293 };
00294 
00295 
00296 inline void MemBufInputSource::setCopyBufToStream(const bool newState)
00297 {
00298     fCopyBufToStream = newState;
00299 }
00300 
00301 XERCES_CPP_NAMESPACE_END
00302 
00303 #endif