char *pName = nsnull; rv = pLoc->GetLeafName( &pName);
nsXPIDLCString pName; rv = pLoc->GetLeafName(getter_Copies(pName));
NS_IMETHODIMP ImportAddressImpl::FindAddressBooks(nsIFileSpec *pLoc, nsISupportsArray **ppArray){    NS_PRECONDITION(pLoc != nsnull, "null ptr");    NS_PRECONDITION(ppArray != nsnull, "null ptr");    if (!pLoc || !ppArray)        return NS_ERROR_NULL_POINTER;		ClearSampleFile();	*ppArray = nsnull;	PRBool exists = PR_FALSE;	nsresult rv = pLoc->Exists( &exists);	if (NS_FAILED( rv) || !exists)		return( NS_ERROR_FAILURE);		PRBool isFile = PR_FALSE;	rv = pLoc->IsFile( &isFile);	if (NS_FAILED( rv) || !isFile)		return( NS_ERROR_FAILURE);	rv = m_text.DetermineDelim( pLoc);		if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Error determining delimitter\n");		return( rv);	}	m_haveDelim = PR_TRUE;	m_delim = m_text.GetDelim();		m_fileLoc = pLoc;	NS_ADDREF( m_fileLoc);	/* Build an address book descriptor based on the file passed in! */	nsCOMPtr<nsISupportsArray>	array;	rv = NS_NewISupportsArray( getter_AddRefs( array));	if (NS_FAILED( rv)) {		IMPORT_LOG0( "FAILED to allocate the nsISupportsArray\n");		return( rv);	}			NS_WITH_SERVICE( nsIImportService, impSvc, kImportServiceCID, &rv);	if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Failed to obtain the import service\n");		return( rv);	}		char *pName = nsnull;	rv = pLoc->GetLeafName( &pName);	if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Failed getting leaf name of file\n");		return( rv);	}	nsString	name; name.AssignWithConversion(pName);	PRInt32		idx = name.RFindChar( '.');	if ((idx != -1) && (idx > 0) && ((name.Length() - idx - 1) < 5)) {		nsString t;		name.Left( t, idx);		name = t;	}	nsCOMPtr<nsIImportABDescriptor>	desc;	nsISupports *					pInterface;	rv = impSvc->CreateNewABDescriptor( getter_AddRefs( desc));	if (NS_SUCCEEDED( rv)) {		PRUint32 sz = 0;		pLoc->GetFileSize( &sz);			desc->SetPreferredName( name.GetUnicode());		desc->SetSize( sz);		nsIFileSpec *pSpec = nsnull;		desc->GetFileSpec( &pSpec);		if (pSpec) {			pSpec->FromFileSpec( pLoc);			NS_RELEASE( pSpec);		}		rv = desc->QueryInterface( kISupportsIID, (void **) &pInterface);		array->AppendElement( pInterface);		pInterface->Release();	}	if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Error creating address book descriptor for text import\n");	}			else {		rv = array->QueryInterface( NS_GET_IID(nsISupportsArray), (void **) ppArray);	}	return( rv);}