本文整理汇总了C++中nsAutoTArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoTArray::IsEmpty方法的具体用法?C++ nsAutoTArray::IsEmpty怎么用?C++ nsAutoTArray::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAutoTArray
的用法示例。
在下文中一共展示了nsAutoTArray::IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tagStr
NS_IMETHODIMP
RDFContentSinkImpl::HandleEndElement(const PRUnichar *aName)
{
FlushText();
nsIRDFResource* resource;
if (NS_FAILED(PopContext(resource, mState, mParseMode))) {
// XXX parser didn't catch unmatched tags?
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_WARNING)) {
nsAutoString tagStr(aName);
char* tagCStr = ToNewCString(tagStr);
PR_LogPrint
("rdfxml: extra close tag '%s' at line %d",
tagCStr, 0/*XXX fix me */);
NS_Free(tagCStr);
}
#endif
return NS_ERROR_UNEXPECTED; // XXX
}
// If we've just popped a member or property element, _now_ is the
// time to add that element to the graph.
switch (mState) {
case eRDFContentSinkState_InMemberElement:
{
nsCOMPtr<nsIRDFContainer> container;
NS_NewRDFContainer(getter_AddRefs(container));
container->Init(mDataSource, GetContextElement(1));
container->AppendElement(resource);
}
break;
case eRDFContentSinkState_InPropertyElement:
{
mDataSource->Assert(GetContextElement(1), GetContextElement(0), resource, true);
} break;
default:
break;
}
if (mContextStack->IsEmpty())
mState = eRDFContentSinkState_InEpilog;
NS_IF_RELEASE(resource);
return NS_OK;
}
示例2:
nsresult
RDFContentSinkImpl::PopContext(nsIRDFResource *&aResource,
RDFContentSinkState &aState,
RDFContentSinkParseMode &aParseMode)
{
if ((nsnull == mContextStack) ||
(mContextStack->IsEmpty())) {
return NS_ERROR_NULL_POINTER;
}
PRUint32 i = mContextStack->Length() - 1;
RDFContextStackElement &e = mContextStack->ElementAt(i);
aResource = e.mResource;
NS_IF_ADDREF(aResource);
aState = e.mState;
aParseMode = e.mParseMode;
mContextStack->RemoveElementAt(i);
return NS_OK;
}