⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 schemaelementdecl.hpp

📁 开源xml解析库,非常有名
💻 HPP
📖 第 1 页 / 共 2 页
字号:
    return 0;}inline voidSchemaElementDecl::setContentModel(XMLContentModel* const){    //Handled by complexType}// ---------------------------------------------------------------------------//  SchemaElementDecl: Getter methods// ---------------------------------------------------------------------------inline SchemaElementDecl::ModelTypes SchemaElementDecl::getModelType() const{    if (fComplexTypeInfo) {        return (SchemaElementDecl::ModelTypes) fComplexTypeInfo->getContentType();    }    return fModelType;}inline PSVIDefs::PSVIScope SchemaElementDecl::getPSVIScope() const{    return fPSVIScope;}inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const{    return fDatatypeValidator;}inline int SchemaElementDecl::getEnclosingScope() const{    return fEnclosingScope;}inline int SchemaElementDecl::getFinalSet() const{    return fFinalSet;}inline int SchemaElementDecl::getBlockSet() const{    return fBlockSet;}inline int SchemaElementDecl::getMiscFlags() const{    return fMiscFlags;}inline XMLCh* SchemaElementDecl::getDefaultValue() const{    return fDefaultValue;}inline ComplexTypeInfo* SchemaElementDecl::getComplexTypeInfo() const{    return fComplexTypeInfo;}inline const SchemaAttDef* SchemaElementDecl::getAttWildCard() const {    return fAttWildCard;}inline SchemaAttDef* SchemaElementDecl::getAttWildCard() {    return fAttWildCard;}inline bool SchemaElementDecl::isGlobalDecl() const {    return (fEnclosingScope == Grammar::TOP_LEVEL_SCOPE);}inline SchemaElementDecl*SchemaElementDecl::getSubstitutionGroupElem() const {    return fSubstitutionGroupElem;}inline const XMLCh* SchemaElementDecl::getTypeName() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if (fXsiComplexTypeInfo)        return fXsiComplexTypeInfo->getTypeLocalName();    else if (fComplexTypeInfo)         return fComplexTypeInfo->getTypeLocalName();    else if(fXsiSimpleTypeInfo)        return fXsiSimpleTypeInfo->getTypeLocalName();    else if(fDatatypeValidator)        return fDatatypeValidator->getTypeLocalName();    //its anyType if we have not done validation on it or none of the above exist    return SchemaSymbols::fgATTVAL_ANYTYPE;}inline PSVIDefs::Complexity SchemaElementDecl::getTypeType() const {    if(getModelType() == Simple) {        return PSVIDefs::SIMPLE;    }    else {        return PSVIDefs::COMPLEX;    }}inline const XMLCh* SchemaElementDecl::getTypeUri() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if (fXsiComplexTypeInfo)        return fXsiComplexTypeInfo->getTypeUri();    else if (fComplexTypeInfo)        return fComplexTypeInfo->getTypeUri();    else if(fXsiSimpleTypeInfo)        return fXsiSimpleTypeInfo->getTypeUri();    else if(fDatatypeValidator)        return fDatatypeValidator->getTypeUri();    //its anyType if we have not done validation on it or none of the above exist    return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;}inline const XMLCh* SchemaElementDecl::getMemberTypeName() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeName();    else if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeName();    return 0;}inline const XMLCh* SchemaElementDecl::getMemberTypeUri() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeUri();    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeUri();    return 0;}inline bool SchemaElementDecl::getMemberTypeAnonymous() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeAnonymous();    else if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeAnonymous();    return false;}inline bool SchemaElementDecl::isTypeDefinitionUnion() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now   if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union ||      fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)       return true;    return false;}inline PSVIDefs::Validity SchemaElementDecl::getValidity() const {    return fValidity;}inline PSVIDefs::Validation SchemaElementDecl::getValidationAttempted() const {    if(!fHadContent)        return fValidation;    if(!fSeenNoValidation && fSeenValidation)        return PSVIDefs::FULL;    else if(fSeenNoValidation && !fSeenValidation)        return PSVIDefs::NONE;    else        return PSVIDefs::PARTIAL;}inline bool SchemaElementDecl::getTypeAnonymous() const {        //REVISIT - since xsi type have to be accessed through names     //presumeably they cannot be anonymous        if (fXsiComplexTypeInfo) {        return fXsiComplexTypeInfo->getAnonymous();    }    else if (fComplexTypeInfo) {        return fComplexTypeInfo->getAnonymous();    }    else if(fXsiSimpleTypeInfo) {        return fXsiSimpleTypeInfo->getAnonymous();    }    else if(fDatatypeValidator){        return fDatatypeValidator->getAnonymous();    }    return false;}inline const XMLCh* SchemaElementDecl::getDOMTypeInfoName() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if(fValidity != PSVIDefs::VALID) {        if(getTypeType() == PSVIDefs::SIMPLE)            return SchemaSymbols::fgDT_ANYSIMPLETYPE;        else            return SchemaSymbols::fgATTVAL_ANYTYPE;    }    if(getTypeAnonymous() || getMemberTypeAnonymous())        return 0;    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeName();    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeName();    return getTypeName();}inline const XMLCh* SchemaElementDecl::getDOMTypeInfoUri() const {    // removing fXsi* references would break DOMTypeInfo implementation completely;    // will have to wait for now    if(fValidity != PSVIDefs::VALID)        return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;    if(getTypeAnonymous() || getMemberTypeAnonymous())        return 0;    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeUri();    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeUri();    return getTypeUri();}// ---------------------------------------------------------------------------//  SchemaElementDecl: Setter methods// ---------------------------------------------------------------------------inline voidSchemaElementDecl::setElemId(unsigned int){    //there is not getElemId so this is not needed. mark deprecated.    //fElemId = elemId;}inline voidSchemaElementDecl::setModelType(const SchemaElementDecl::ModelTypes toSet){    fModelType = toSet;}inline voidSchemaElementDecl::setPSVIScope(const PSVIDefs::PSVIScope toSet){    fPSVIScope = toSet;}inline void SchemaElementDecl::setDatatypeValidator(DatatypeValidator* newDatatypeValidator){    fDatatypeValidator = newDatatypeValidator;}inline void SchemaElementDecl::setEnclosingScope(const int newEnclosingScope){    fEnclosingScope = newEnclosingScope;}inline void SchemaElementDecl::setFinalSet(const int finalSet){    fFinalSet = finalSet;}inline void SchemaElementDecl::setBlockSet(const int blockSet){    fBlockSet = blockSet;}inline void SchemaElementDecl::setMiscFlags(const int flags){    fMiscFlags = flags;}inline void SchemaElementDecl::setDefaultValue(const XMLCh* const value){    if (fDefaultValue) {        getMemoryManager()->deallocate(fDefaultValue);//delete[] fDefaultValue;    }    fDefaultValue = XMLString::replicate(value, getMemoryManager());}inline voidSchemaElementDecl::setComplexTypeInfo(ComplexTypeInfo* const typeInfo){    fComplexTypeInfo = typeInfo;}inline voidSchemaElementDecl::setXsiComplexTypeInfo(ComplexTypeInfo* const typeInfo){    fXsiComplexTypeInfo = typeInfo;}inline voidSchemaElementDecl::setXsiSimpleTypeInfo(const DatatypeValidator* const dtv){    fXsiSimpleTypeInfo = dtv;}inline voidSchemaElementDecl::setAttWildCard(SchemaAttDef* const attWildCard) {    if (fAttWildCard)        delete fAttWildCard;    fAttWildCard = attWildCard;}inline voidSchemaElementDecl::setSubstitutionGroupElem(SchemaElementDecl* const elemDecl) {    fSubstitutionGroupElem = elemDecl;}inline void SchemaElementDecl::setValidity(PSVIDefs::Validity valid) {    fValidity = valid;}inline void SchemaElementDecl::setValidationAttempted(PSVIDefs::Validation validation) {    fValidation = validation;}inline void SchemaElementDecl::updateValidityFromAttribute(const SchemaAttDef *def) {    PSVIDefs::Validation curValAttemted = def->getValidationAttempted();    PSVIDefs::Validity curVal = def->getValidity();            if(curValAttemted == PSVIDefs::NONE || curValAttemted == PSVIDefs::PARTIAL) {        fSeenNoValidation = true;        fValidity = PSVIDefs::UNKNOWN;    }    else {        fSeenValidation = true;    }            if(curVal == PSVIDefs::INVALID)        fValidity = PSVIDefs::INVALID;    fHadContent = true;}inline void SchemaElementDecl::updateValidityFromElement(const XMLElementDecl *decl, Grammar::GrammarType eleGrammar) {    if (eleGrammar == Grammar::SchemaGrammarType) {                            PSVIDefs::Validation curValAttemted = ((SchemaElementDecl *)decl)->getValidationAttempted();        PSVIDefs::Validity curVal = ((SchemaElementDecl *)decl)->getValidity();                if(curValAttemted == PSVIDefs::NONE || curValAttemted == PSVIDefs::PARTIAL) {            fSeenNoValidation = true;            fValidity = PSVIDefs::UNKNOWN;        }        else {            fSeenValidation = true;        }                if(curVal == PSVIDefs::INVALID)            fValidity = PSVIDefs::INVALID;    }    fHadContent = true;}inline void SchemaElementDecl::reset() {    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)        ((UnionDatatypeValidator *)fXsiSimpleTypeInfo)->reset();    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)        ((UnionDatatypeValidator *)fDatatypeValidator)->reset();    setXsiSimpleTypeInfo(0);    setXsiComplexTypeInfo(0);    fValidity = PSVIDefs::UNKNOWN;    fValidation = PSVIDefs::NONE;        fSeenValidation = false;    fSeenNoValidation = false;    fHadContent = false;}// ---------------------------------------------------------------------------//  SchemaElementDecl: IC methods// ---------------------------------------------------------------------------inline voidSchemaElementDecl::addIdentityConstraint(IdentityConstraint* const ic) {    if (!fIdentityConstraints) {        fIdentityConstraints = new (getMemoryManager()) RefVectorOf<IdentityConstraint>(16, true, getMemoryManager());    }    fIdentityConstraints->addElement(ic);}inline unsigned int SchemaElementDecl::getIdentityConstraintCount() const {    if (fIdentityConstraints) {        return fIdentityConstraints->size();    }    return 0;}inline IdentityConstraint*SchemaElementDecl::getIdentityConstraintAt(unsigned int index) const {    if (fIdentityConstraints) {        return fIdentityConstraints->elementAt(index);    }    return 0;}XERCES_CPP_NAMESPACE_END#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -