本文整理汇总了C++中item::Ptr::generateEvents方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::generateEvents方法的具体用法?C++ Ptr::generateEvents怎么用?C++ Ptr::generateEvents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item::Ptr
的用法示例。
在下文中一共展示了Ptr::generateEvents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateEventsImpl
EventGenerator::Ptr XQCopy::generateEventsImpl(const Item::Ptr &toBeCopied, EventHandler *events, DynamicContext *context,
bool preserveNS, bool preserveType) const
{
if(!toBeCopied->isNode()) {
toBeCopied->generateEvents(events, context, preserveNS, preserveType);
return 0;
}
Node *node = (Node*)toBeCopied.get();
if(node->dmNodeKind() == Node::element_string) {
NoInheritFilter niFilter(events, context->getMemoryManager());
if(!inheritNamespaces_) events = &niFilter;
AnyAtomicType::Ptr itemName = node->dmNodeName(context);
const ATQNameOrDerived *pQName = (const ATQNameOrDerived*)itemName.get();
const XMLCh *prefix = emptyToNull(pQName->getPrefix());
const XMLCh *uri = emptyToNull(pQName->getURI());
const XMLCh *localname = pQName->getName();
events->startElementEvent(prefix, uri, localname);
ElemConstructFilter elemFilter(events, this, context->getMemoryManager());
if(copyNamespaces_) {
Result nsnodes = node->dmNamespaceNodes(context, this);
Item::Ptr ns;
while((ns = nsnodes->next(context)).notNull()) {
ns->generateEvents(&elemFilter, context, preserveNS, preserveType);
}
}
for(VectorOfASTNodes::const_iterator itCont = children_.begin(); itCont != children_.end (); ++itCont) {
(*itCont)->generateAndTailCall(&elemFilter, context, preserveNS, preserveType);
}
// TBD validation and type - jpcs
const XMLCh *typeURI = SchemaSymbols::fgURI_SCHEMAFORSCHEMA;
const XMLCh *typeName = DocumentCache::g_szUntyped;
events->endElementEvent(prefix, uri, localname, typeURI, typeName);
}
else if(node->dmNodeKind() == Node::document_string) {
events->startDocumentEvent(0, 0);
DocConstructFilter filter(events, this);
for(VectorOfASTNodes::const_iterator itCont = children_.begin(); itCont != children_.end (); ++itCont) {
(*itCont)->generateAndTailCall(&filter, context, preserveNS, preserveType);
}
events->endDocumentEvent();
}
else {
node->generateEvents(events, context, preserveNS, preserveType);
}
return 0;
}