📄 schemagrammar.hpp
字号:
// fValidated // Indicates if the content of the Grammar has been pre-validated // or not (UPA checking, etc.). When using a cached grammar, no need // for pre content validation. // // fGramDesc: adopted // // ----------------------------------------------------------------------- XMLCh* fTargetNamespace; RefHash3KeysIdPool<SchemaElementDecl>* fElemDeclPool; RefHash3KeysIdPool<SchemaElementDecl>* fElemNonDeclPool; RefHash3KeysIdPool<SchemaElementDecl>* fGroupElemDeclPool; NameIdPool<XMLNotationDecl>* fNotationDeclPool; RefHashTableOf<XMLAttDef>* fAttributeDeclRegistry; RefHashTableOf<ComplexTypeInfo>* fComplexTypeRegistry; RefHashTableOf<XercesGroupInfo>* fGroupInfoRegistry; RefHashTableOf<XercesAttGroupInfo>* fAttGroupInfoRegistry; NamespaceScope* fNamespaceScope; RefHash2KeysTableOf<ElemVector>* fValidSubstitutionGroups; ValidationContext* fValidationContext; MemoryManager* fMemoryManager; XMLSchemaDescription* fGramDesc; RefHashTableOf<XSAnnotation>* fAnnotations; bool fValidated; DatatypeValidatorFactory fDatatypeRegistry;};// ---------------------------------------------------------------------------// SchemaGrammar: Getter methods// ---------------------------------------------------------------------------inline RefHash3KeysIdPoolEnumerator<SchemaElementDecl>SchemaGrammar::getElemEnumerator() const{ return RefHash3KeysIdPoolEnumerator<SchemaElementDecl>(fElemDeclPool, false, fMemoryManager);}inline NameIdPoolEnumerator<XMLNotationDecl>SchemaGrammar::getNotationEnumerator() const{ return NameIdPoolEnumerator<XMLNotationDecl>(fNotationDeclPool, fMemoryManager);}inline RefHashTableOf<XMLAttDef>* SchemaGrammar::getAttributeDeclRegistry() const { return fAttributeDeclRegistry;}inline RefHashTableOf<ComplexTypeInfo>*SchemaGrammar::getComplexTypeRegistry() const { return fComplexTypeRegistry;}inline RefHashTableOf<XercesGroupInfo>*SchemaGrammar::getGroupInfoRegistry() const { return fGroupInfoRegistry;}inline RefHashTableOf<XercesAttGroupInfo>*SchemaGrammar::getAttGroupInfoRegistry() const { return fAttGroupInfoRegistry;}inline DatatypeValidatorFactory* SchemaGrammar::getDatatypeRegistry() { return &fDatatypeRegistry;}inline NamespaceScope* SchemaGrammar::getNamespaceScope() const { return fNamespaceScope;}inline RefHash2KeysTableOf<ElemVector>*SchemaGrammar::getValidSubstitutionGroups() const { return fValidSubstitutionGroups;}inline RefHashTableOf<XMLRefInfo>* SchemaGrammar::getIDRefList() const { return fValidationContext->getIdRefList();}inline ValidationContext* SchemaGrammar::getValidationContext() const { return fValidationContext;}inline XMLGrammarDescription* SchemaGrammar::getGrammarDescription() const{ return fGramDesc;}inline XSAnnotation* SchemaGrammar::getAnnotation(const void* const key){ return fAnnotations->get(key);}inline const XSAnnotation* SchemaGrammar::getAnnotation(const void* const key) const{ return fAnnotations->get(key);}inline XSAnnotation* SchemaGrammar::getAnnotation(){ return fAnnotations->get(this);}inline const XSAnnotation* SchemaGrammar::getAnnotation() const{ return fAnnotations->get(this);}inline RefHashTableOf<XSAnnotation>* SchemaGrammar::getAnnotations(){ return fAnnotations;}inline const RefHashTableOf<XSAnnotation>* SchemaGrammar::getAnnotations() const{ return fAnnotations;}// -----------------------------------------------------------------------// Setter methods// -----------------------------------------------------------------------inline void SchemaGrammar::setTargetNamespace(const XMLCh* const targetNamespace){ if (fTargetNamespace) fMemoryManager->deallocate(fTargetNamespace);//delete [] fTargetNamespace; fTargetNamespace = XMLString::replicate(targetNamespace, fMemoryManager);}inline voidSchemaGrammar::setAttributeDeclRegistry(RefHashTableOf<XMLAttDef>* const attReg) { fAttributeDeclRegistry = attReg;}inline voidSchemaGrammar::setComplexTypeRegistry(RefHashTableOf<ComplexTypeInfo>* const other) { fComplexTypeRegistry = other;}inline voidSchemaGrammar::setGroupInfoRegistry(RefHashTableOf<XercesGroupInfo>* const other) { fGroupInfoRegistry = other;}inline voidSchemaGrammar::setAttGroupInfoRegistry(RefHashTableOf<XercesAttGroupInfo>* const other) { fAttGroupInfoRegistry = other;}inline void SchemaGrammar::setNamespaceScope(NamespaceScope* const nsScope) { fNamespaceScope = nsScope;}inline voidSchemaGrammar::setValidSubstitutionGroups(RefHash2KeysTableOf<ElemVector>* const other) { fValidSubstitutionGroups = other;}// ---------------------------------------------------------------------------// SchemaGrammar: Virtual methods// ---------------------------------------------------------------------------inline Grammar::GrammarType SchemaGrammar::getGrammarType() const { return Grammar::SchemaGrammarType;}inline const XMLCh* SchemaGrammar::getTargetNamespace() const { return fTargetNamespace;}// Element Declinline unsigned int SchemaGrammar::getElemId (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ) const{ // // In this case, we don't return zero to mean 'not found', so we have to // map it to the official not found value if we don't find it. // const SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) return XMLElementDecl::fgInvalidElemId; } return decl->getId();}inline const XMLElementDecl* SchemaGrammar::getElemDecl( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ) const{ const SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl && fElemNonDeclPool) decl = fElemNonDeclPool->getByKey(baseName, uriId, scope); } return decl;}inline XMLElementDecl* SchemaGrammar::getElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ){ SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl && fElemNonDeclPool) decl = fElemNonDeclPool->getByKey(baseName, uriId, scope); } return decl;}inline const XMLElementDecl* SchemaGrammar::getElemDecl(const unsigned int elemId) const{ // Look up this element decl by id const SchemaElementDecl* decl = fElemDeclPool->getById(elemId); if (!decl) decl = fGroupElemDeclPool->getById(elemId); return decl;}inline XMLElementDecl* SchemaGrammar::getElemDecl(const unsigned int elemId){ // Look up this element decl by id SchemaElementDecl* decl = fElemDeclPool->getById(elemId); if (!decl) decl = fGroupElemDeclPool->getById(elemId); return decl;}inline unsigned intSchemaGrammar::putElemDecl(XMLElementDecl* const elemDecl, const bool notDeclared) { if (notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool<SchemaElementDecl>(29, true, 128, fMemoryManager); return fElemNonDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl); } return fElemDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl);}inline unsigned int SchemaGrammar::putGroupElemDecl (XMLElementDecl* const elemDecl) const{ return fGroupElemDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl);}// Notation Declinline const XMLNotationDecl* SchemaGrammar::getNotationDecl(const XMLCh* const notName) const{ return fNotationDeclPool->getByKey(notName);}inline XMLNotationDecl* SchemaGrammar::getNotationDecl(const XMLCh* const notName){ return fNotationDeclPool->getByKey(notName);}inline unsigned int SchemaGrammar::putNotationDecl(XMLNotationDecl* const notationDecl) const{ return fNotationDeclPool->put(notationDecl);}inline bool SchemaGrammar::getValidated() const{ return fValidated;}inline void SchemaGrammar::setValidated(const bool newState){ fValidated = newState;}XERCES_CPP_NAMESPACE_END#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -