rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "IsContainer", &kHTTPIndex_IsContainer); if (NS_FAILED(rv)) return rv;
nsHTTPIndexParser::Init(){  NS_PRECONDITION(mHTTPIndex, "not initialized");  if (! mHTTPIndex)    return NS_ERROR_NOT_INITIALIZED;  nsresult rv;  mDataSource = do_QueryInterface(mHTTPIndex, &rv);  if (NS_FAILED(rv)) return rv;  // No datasource. Uh oh. We won't be much use then.  if (! mDataSource)    return NS_ERROR_UNEXPECTED;  if (gRefCntParser++ == 0) {    rv = nsServiceManager::GetService("@mozilla.org/rdf/rdf-service;1",                                      NS_GET_IID(nsIRDFService),                                      NS_REINTERPRET_CAST(nsISupports**, &gRDF));    if (NS_FAILED(rv)) return rv;    rv = nsServiceManager::GetService(NS_ITEXTTOSUBURI_CONTRACTID,                                      NS_GET_IID(nsITextToSubURI),                                      NS_REINTERPRET_CAST(nsISupports**, &gTextToSubURI));    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "Comment",                           &kHTTPIndex_Comment);    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "Name",                           &kHTTPIndex_Filename);    if (NS_FAILED(rv)) return rv;        rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "Description",                           &kHTTPIndex_Description);    if (NS_FAILED(rv)) return rv;        rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "File-Type",                           &kHTTPIndex_Filetype);    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "loading",                           &kHTTPIndex_Loading);    if (NS_FAILED(rv)) return rv;        rv = gRDF->GetResource(HTTPINDEX_NAMESPACE_URI "URL",                           &kHTTPIndex_URL);    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetResource(NC_NAMESPACE_URI "child",                           &kNC_Child);    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetLiteral(NS_LITERAL_STRING("true").get(),                          &kTrueLiteral);    if (NS_FAILED(rv)) return rv;    rv = gRDF->GetLiteral(NS_LITERAL_STRING("false").get(),                          &kFalseLiteral);    if (NS_FAILED(rv)) return rv;    for (Field* field = gFieldTable; field->mName; ++field) {      nsCAutoString str(field->mResName);      rv = gRDF->GetResource(str, &field->mProperty);      if (NS_FAILED(rv)) return rv;    }  }  return NS_OK;}