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 #if !defined(MEMBUFINPUTSOURCE_HPP)
00085 #define MEMBUFINPUTSOURCE_HPP
00086
00087 #include <sax/InputSource.hpp>
00088
00089 class BinInputStream;
00090
00091
00120 class MemBufInputSource : public InputSource
00121 {
00122 public :
00123
00124
00125
00126
00128
00129
00149 MemBufInputSource
00150 (
00151 const XMLByte* const srcDocBytes
00152 , const unsigned int byteCount
00153 , const XMLCh* const bufId
00154 , const bool adoptBuffer = false
00155 );
00156
00161 MemBufInputSource
00162 (
00163 const XMLByte* const srcDocBytes
00164 , const unsigned int byteCount
00165 , const char* const bufId
00166 , const bool adoptBuffer = false
00167 );
00168
00169
00171
00176 ~MemBufInputSource();
00177
00178
00179
00180
00181
00182
00183
00185
00186
00197 BinInputStream* makeStream() const;
00198
00199
00200
00201
00202
00203
00204
00205
00207
00208
00209
00225 void setCopyBufToStream(const bool newState);
00226
00227
00228
00229
00230 private :
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253 bool fAdopted;
00254 unsigned int fByteCount;
00255 bool fCopyBufToStream;
00256 const XMLByte* fSrcBytes;
00257 };
00258
00259
00260 inline void MemBufInputSource::setCopyBufToStream(const bool newState)
00261 {
00262 fCopyBufToStream = newState;
00263 }
00264
00265 #endif