本文整理汇总了C++中TypeManager::create_named_type方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeManager::create_named_type方法的具体用法?C++ TypeManager::create_named_type怎么用?C++ TypeManager::create_named_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeManager
的用法示例。
在下文中一共展示了TypeManager::create_named_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createAtomicOrUnionType
SequenceType SequenceType::createAtomicOrUnionType(
const StaticContext_t& sctx,
const String& uri,
const String& localName,
Quantifier quant)
{
TypeManager* tm;
if (sctx == NULL)
{
tm = &GENV_TYPESYSTEM;
}
else
{
static_context* sctx2 = Unmarshaller::getInternalStaticContext(sctx);
tm = sctx2->get_typemanager();
}
zstring& ns = Unmarshaller::getInternalString(uri);
zstring& local = Unmarshaller::getInternalString(localName);
store::Item_t qname;
GENV_ITEMFACTORY->createQName(qname, ns, "", local);
xqtref_t type = tm->create_named_type(qname, quant, QueryLoc::null, false);
if (type->isGenAtomicAny())
return Unmarshaller::createSequenceType(type.getp());
return Unmarshaller::createSequenceType(NULL);
}
示例2: createElementType
SequenceType SequenceType::createElementType(
const StaticContext_t& sctx,
const String& nodeUri,
const String& nodeLocalName,
const String& typeUri,
const String& typeLocalName,
bool nillable,
Quantifier quant)
{
TypeManager* tm;
if (sctx == NULL)
{
tm = &GENV_TYPESYSTEM;
}
else
{
static_context* sctx2 = Unmarshaller::getInternalStaticContext(sctx);
tm = sctx2->get_typemanager();
}
zstring& nodeNS = Unmarshaller::getInternalString(nodeUri);
zstring& nodeLocal = Unmarshaller::getInternalString(nodeLocalName);
store::Item_t nodeQName;
if (!nodeLocal.empty())
GENV_ITEMFACTORY->createQName(nodeQName, nodeNS, "", nodeLocal);
zstring& typeNS = Unmarshaller::getInternalString(typeUri);
zstring& typeLocal = Unmarshaller::getInternalString(typeLocalName);
store::Item_t typeQName;
xqtref_t contentType;
if (!typeLocal.empty())
{
GENV_ITEMFACTORY->createQName(typeQName, typeNS, "", typeLocal);
contentType = tm->create_named_type(typeQName, QUANT_ONE, QueryLoc::null, false);
if (contentType == NULL)
return Unmarshaller::createSequenceType(NULL);
}
xqtref_t res = tm->create_node_type(store::StoreConsts::elementNode,
nodeQName,
contentType,
quant,
nillable,
false);
return Unmarshaller::createSequenceType(res.getp());
}
示例3: deepEqualNodes
//.........这里部分代码省略.........
else if (!deepEqual(loc, sctx, value1, value2, collator, timezone, raiseError))
return false;
}
}
else
{
return false;
}
}
else if (item2->haveSimpleContent())
{
return false;
}
else
{
store::Item* typename1 = item1->getType();
store::Item* typename2 = item2->getType();
if (typename1->equals(typename2))
{
return deepEqualChildren(loc,
sctx,
item1->getChildren(),
item2->getChildren(),
collator,
timezone,
raiseError);
}
else
{
TypeManager* tm = sctx->get_typemanager();
xqtref_t type1 =
tm->create_named_type(typename1, SequenceType::QUANT_ONE, loc, raiseError);
xqtref_t type2 =
tm->create_named_type(typename2, SequenceType::QUANT_ONE, loc, raiseError);
ZORBA_ASSERT(type1->isComplex() && type2->isComplex());
if (type1->contentKind() != type2->contentKind())
return false;
return deepEqualChildren(loc,
sctx,
item1->getChildren(),
item2->getChildren(),
collator,
timezone,
raiseError);
}
}
break;
}
case store::StoreConsts::attributeNode:
{
if (! item1->getNodeName()->equals(item2->getNodeName()))
return false;
store::Item_t value1, value2;
store::Iterator_t ite1, ite2;
item1->getTypedValue(value1, ite1);
item2->getTypedValue(value2, ite2);
if (ite1 == NULL && ite2 == NULL)
{