InputSource.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BASE_IINPUTSOURCE_H
00024 #define BASE_IINPUTSOURCE_H
00025
00026
00027 #include <iostream>
00028
00029 #include <xercesc/sax2/Attributes.hpp>
00030 #include <xercesc/util/BinInputStream.hpp>
00031 #include <xercesc/util/PlatformUtils.hpp>
00032 #include <xercesc/util/XercesVersion.hpp>
00033 #include <xercesc/sax/InputSource.hpp>
00034
00035
00036 XERCES_CPP_NAMESPACE_BEGIN
00037 class BinInputStream;
00038 XERCES_CPP_NAMESPACE_END
00039
00040 namespace Base
00041 {
00042
00043
00044 class BaseExport StdInputStream : public XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream
00045 {
00046 public :
00047 StdInputStream ( std::istream& Stream, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const manager = XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager );
00048 virtual ~StdInputStream();
00049
00050
00051
00052
00053 #if (XERCES_VERSION_MAJOR == 2)
00054 virtual unsigned int curPos() const;
00055 virtual unsigned int readBytes( XMLByte* const toFill, const unsigned int maxToRead );
00056 #else
00057 virtual XMLFilePos curPos() const;
00058 virtual XMLSize_t readBytes( XMLByte* const toFill, const XMLSize_t maxToRead );
00059 virtual const XMLCh* getContentType() const {return 0;}
00060 #endif
00061
00062 private :
00063
00064
00065
00066 StdInputStream(const StdInputStream&);
00067 StdInputStream& operator=(const StdInputStream&);
00068
00069
00070
00071
00072
00073
00074
00075
00076 std::istream &stream;
00077 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const fMemoryManager;
00078 };
00079
00080
00081 class BaseExport StdInputSource : public XERCES_CPP_NAMESPACE_QUALIFIER InputSource
00082 {
00083 public :
00084 StdInputSource ( std::istream& Stream, const char* filePath, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const manager = XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager );
00085 ~StdInputSource();
00086
00087 virtual XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream* makeStream() const;
00088
00089 private:
00090 StdInputSource(const StdInputSource&);
00091 StdInputSource& operator=(const StdInputSource&);
00092
00093 std::istream &stream;
00094 };
00095
00096 }
00097
00098 #endif // BASE_IINPUTSOURCE_H