else if (property == kNC_IsDirectory) { PRBool isDir = isDirURI(source); PRBool isEqual = PR_FALSE; target->EqualsNode(kLiteralTrue, &isEqual); if (isEqual) *hasAssertion = isDir; else { target->EqualsNode(kLiteralFalse, &isEqual); if (isEqual) *hasAssertion = !isDir; } }
FileSystemDataSource::HasAssertion(nsIRDFResource *source,                             nsIRDFResource *property,                             nsIRDFNode *target,                             PRBool tv,                             PRBool *hasAssertion /* out */){	NS_PRECONDITION(source != nsnull, "null ptr");	if (! source)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(property != nsnull, "null ptr");	if (! property)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(target != nsnull, "null ptr");	if (! target)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(hasAssertion != nsnull, "null ptr");	if (! hasAssertion)		return NS_ERROR_NULL_POINTER;	// we only have positive assertions in the file system data source.	*hasAssertion = PR_FALSE;	if (! tv) {		return NS_OK;	}	if ((source == kNC_FileSystemRoot) || isFileURI(source))	{		if (property == kRDF_type)		{			nsCOMPtr<nsIRDFResource> resource( do_QueryInterface(target) );			if (resource.get() == kRDF_type) {				*hasAssertion = PR_TRUE;			}		}#ifdef USE_NC_EXTENSION		else if (property == kNC_extension)		{			// Cheat just a little here by making dirs always match			if (isDirURI(source))				*hasAssertion = PR_TRUE;			else {				nsCOMPtr<nsIRDFLiteral> extension;				GetExtension(source, getter_AddRefs(extension));				if (extension.get() == target) {					*hasAssertion = PR_TRUE;				}			}		}#endif	}	return NS_OK;}