File indexing completed on 2025-01-18 10:14:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_DGXMLSCANNER_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DGXMLSCANNER_HPP
0024
0025 #include <xercesc/internal/XMLScanner.hpp>
0026 #include <xercesc/util/ValueVectorOf.hpp>
0027 #include <xercesc/util/NameIdPool.hpp>
0028 #include <xercesc/util/Hash2KeysSetOf.hpp>
0029 #include <xercesc/validators/common/Grammar.hpp>
0030
0031 XERCES_CPP_NAMESPACE_BEGIN
0032
0033 class DTDElementDecl;
0034 class DTDGrammar;
0035 class DTDValidator;
0036
0037
0038
0039 class XMLPARSER_EXPORT DGXMLScanner : public XMLScanner
0040 {
0041 public :
0042
0043
0044
0045 DGXMLScanner
0046 (
0047 XMLValidator* const valToAdopt
0048 , GrammarResolver* const grammarResolver
0049 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0050 );
0051 DGXMLScanner
0052 (
0053 XMLDocumentHandler* const docHandler
0054 , DocTypeHandler* const docTypeHandler
0055 , XMLEntityHandler* const entityHandler
0056 , XMLErrorReporter* const errReporter
0057 , XMLValidator* const valToAdopt
0058 , GrammarResolver* const grammarResolver
0059 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0060 );
0061 virtual ~DGXMLScanner();
0062
0063
0064
0065
0066 virtual const XMLCh* getName() const;
0067 virtual NameIdPool<DTDEntityDecl>* getEntityDeclPool();
0068 virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
0069 virtual void scanDocument
0070 (
0071 const InputSource& src
0072 );
0073 virtual bool scanNext(XMLPScanToken& toFill);
0074 virtual Grammar* loadGrammar
0075 (
0076 const InputSource& src
0077 , const short grammarType
0078 , const bool toCache = false
0079 );
0080
0081 virtual Grammar::GrammarType getCurrentGrammarType() const;
0082
0083 private :
0084
0085
0086
0087 DGXMLScanner();
0088 DGXMLScanner(const DGXMLScanner&);
0089 DGXMLScanner& operator=(const DGXMLScanner&);
0090
0091
0092
0093
0094 virtual void scanCDSection();
0095 virtual void scanCharData(XMLBuffer& toToUse);
0096 virtual EntityExpRes scanEntityRef
0097 (
0098 const bool inAttVal
0099 , XMLCh& firstCh
0100 , XMLCh& secondCh
0101 , bool& escaped
0102 );
0103 virtual void scanDocTypeDecl();
0104 virtual void scanReset(const InputSource& src);
0105 virtual void sendCharData(XMLBuffer& toSend);
0106 virtual InputSource* resolveSystemId(const XMLCh* const sysId
0107 ,const XMLCh* const pubId);
0108
0109
0110
0111
0112 void commonInit();
0113 void cleanUp();
0114
0115 XMLSize_t buildAttList
0116 (
0117 const XMLSize_t attCount
0118 , XMLElementDecl* elemDecl
0119 , RefVectorOf<XMLAttr>& toFill
0120 );
0121 void updateNSMap
0122 (
0123 const XMLCh* const attrPrefix
0124 , const XMLCh* const attrLocalName
0125 , const XMLCh* const attrValue
0126 );
0127 void scanAttrListforNameSpaces(RefVectorOf<XMLAttr>* theAttrList, XMLSize_t attCount, XMLElementDecl* elemDecl);
0128
0129
0130
0131
0132 bool scanAttValue
0133 (
0134 const XMLAttDef* const attDef
0135 , const XMLCh *const attrName
0136 , XMLBuffer& toFill
0137 );
0138 bool scanContent();
0139 void scanEndTag(bool& gotData);
0140 bool scanStartTag(bool& gotData);
0141 bool scanStartTagNS(bool& gotData);
0142
0143
0144
0145
0146 Grammar* loadDTDGrammar(const InputSource& src, const bool toCache = false);
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171 ValueVectorOf<XMLAttr*>* fAttrNSList;
0172 DTDValidator* fDTDValidator;
0173 DTDGrammar* fDTDGrammar;
0174 NameIdPool<DTDElementDecl>* fDTDElemNonDeclPool;
0175 unsigned int fElemCount;
0176 RefHashTableOf<unsigned int, PtrHasher>* fAttDefRegistry;
0177 Hash2KeysSetOf<StringHasher>* fUndeclaredAttrRegistry;
0178 };
0179
0180 inline const XMLCh* DGXMLScanner::getName() const
0181 {
0182 return XMLUni::fgDGXMLScanner;
0183 }
0184
0185 inline Grammar::GrammarType DGXMLScanner::getCurrentGrammarType() const
0186 {
0187 return Grammar::DTDGrammarType;
0188 }
0189
0190 XERCES_CPP_NAMESPACE_END
0191
0192 #endif