当前位置: 首页>>代码示例>>C++>>正文


C++ DatatypeValidator::setTypeName方法代码示例

本文整理汇总了C++中DatatypeValidator::setTypeName方法的典型用法代码示例。如果您正苦于以下问题:C++ DatatypeValidator::setTypeName方法的具体用法?C++ DatatypeValidator::setTypeName怎么用?C++ DatatypeValidator::setTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatatypeValidator的用法示例。


在下文中一共展示了DatatypeValidator::setTypeName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if


//.........这里部分代码省略.........
            datatypeValidator->setFinite(false);
        }
    }
    else {

        if ((baseValidator->getType() != DatatypeValidator::String) && facets) {

            KVStringPair* value = facets->get(SchemaSymbols::fgELT_WHITESPACE);

            if (value != 0) {
                facets->removeKey(SchemaSymbols::fgELT_WHITESPACE);
            }
        }

        datatypeValidator = baseValidator->newInstance
        (
            facets
            , enums
            , finalSet
            , manager
        );

        // Set PSVI information for Ordered, Numeric, Bounded & Finite
        datatypeValidator->setOrdered(baseValidator->getOrdered());
        datatypeValidator->setNumeric(baseValidator->getNumeric());
        RefHashTableOf<KVStringPair>* baseFacets = baseValidator->getFacets();
        if (facets  && 
            ((facets->get(SchemaSymbols::fgELT_MININCLUSIVE) || 
              facets->get(SchemaSymbols::fgELT_MINEXCLUSIVE) ||
              (baseFacets && (baseFacets->get(SchemaSymbols::fgELT_MININCLUSIVE) || 
                              baseFacets->get(SchemaSymbols::fgELT_MINEXCLUSIVE))))) &&
             (facets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || 
              facets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE) || 
              (baseFacets && ((baseFacets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || 
                               baseFacets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE))))))
        {
            datatypeValidator->setBounded(true);
        }
        else
        {
            datatypeValidator->setBounded(false);
        }
        if (baseValidator->getFinite())
        {
            datatypeValidator->setFinite(true);
        }
        else if (!facets)
        {
            datatypeValidator->setFinite(false);
        }
        else if (facets->get(SchemaSymbols::fgELT_LENGTH) || facets->get(SchemaSymbols::fgELT_MAXLENGTH) ||
                 facets->get(SchemaSymbols::fgELT_TOTALDIGITS))
        {
            datatypeValidator->setFinite(true);
        }
        //for efficiency use this instead of rechecking...
        //else if ((facets->get(SchemaSymbols::fgELT_MININCLUSIVE) || facets->get(SchemaSymbols::fgELT_MINEXCLUSIVE)) &&
        //         (facets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || facets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE)))
        else if (datatypeValidator->getBounded() ||
                 datatypeValidator->getType() == DatatypeValidator::Date      || 
                 datatypeValidator->getType() == DatatypeValidator::YearMonth ||
                 datatypeValidator->getType() == DatatypeValidator::Year      ||
                 datatypeValidator->getType() == DatatypeValidator::MonthDay  ||
                 datatypeValidator->getType() == DatatypeValidator::Day       ||
                 datatypeValidator->getType() == DatatypeValidator::Month)
        {
            if (facets->get(SchemaSymbols::fgELT_FRACTIONDIGITS))
            {
                datatypeValidator->setFinite(true);
            }
            else 
            {
                datatypeValidator->setFinite(false);
            }
        }
        else 
        {
            datatypeValidator->setFinite(false);
        }      
    }

    if (datatypeValidator != 0) {

        if (isUserDefined) {

            if (!fUserDefinedRegistry) {
                fUserDefinedRegistry = new (userManager) RefHashTableOf<DatatypeValidator>(29, userManager);
            }

            fUserDefinedRegistry->put((void *)typeName, datatypeValidator);
        }
        else {
            fBuiltInRegistry->put((void *)typeName, datatypeValidator);
        }

        datatypeValidator->setTypeName(typeName);
    }

    return datatypeValidator;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:101,代码来源:DatatypeValidatorFactory.cpp

示例2: expandRegistryToFullSchemaSet

// ---------------------------------------------------------------------------
//  DatatypeValidatorFactory: Registry initialization methods
// ---------------------------------------------------------------------------
void DatatypeValidatorFactory::expandRegistryToFullSchemaSet()
{
    if (!sBuiltInRegistryMutexRegistered)
    {
        if (!sBuiltInRegistryMutex)
        {
            XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
            if (!sBuiltInRegistryMutex)
                sBuiltInRegistryMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
        }

        // Use a faux scope to synchronize while we do this
        {
            XMLMutexLock lock(sBuiltInRegistryMutex);

            // If we got here first, then register it and set the registered flag
            if (!sBuiltInRegistryMutexRegistered)
            {
                //Initialize common Schema/DTD Datatype validator set
                fBuiltInRegistry = new RefHashTableOf<DatatypeValidator>(29);

                DatatypeValidator *dv = new StringDatatypeValidator(); 
                dv->setTypeName(SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_STRING, dv);
            
                dv = new NOTATIONDatatypeValidator();
                dv->setTypeName(XMLUni::fgNotationString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) XMLUni::fgNotationString, dv);

                dv = new AnySimpleTypeDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_ANYSIMPLETYPE, dv);

                dv = new BooleanDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_BOOLEAN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_BOOLEAN, dv);

                dv = new DecimalDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_DECIMAL, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DECIMAL, dv);

                dv = new HexBinaryDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_HEXBINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_HEXBINARY, dv);

                dv = new Base64BinaryDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_BASE64BINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_BASE64BINARY, dv);

                dv = new DoubleDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_DOUBLE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DOUBLE, dv);

                dv = new FloatDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_FLOAT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_FLOAT, dv);

                dv = new AnyURIDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_ANYURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_ANYURI, dv);

                dv = new QNameDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_QNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_QNAME, dv);

                dv = new DateTimeDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_DATETIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DATETIME, dv);

                dv = new DateDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_DATE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DATE, dv);

                dv = new TimeDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_TIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_TIME, dv);

                dv = new DayDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_DAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DAY, dv);

                dv = new MonthDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_MONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_MONTH, dv);

                dv = new MonthDayDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_MONTHDAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_MONTHDAY, dv);

                dv = new YearDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_YEAR, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_YEAR, dv);

                dv = new YearMonthDatatypeValidator();
                dv->setTypeName(SchemaSymbols::fgDT_YEARMONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
                fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_YEARMONTH, dv);

//.........这里部分代码省略.........
开发者ID:jjiezheng,项目名称:pap_full,代码行数:101,代码来源:DatatypeValidatorFactory.cpp


注:本文中的DatatypeValidator::setTypeName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。