本文整理汇总了C++中nsEudoraWin32::ImportAddresses方法的典型用法代码示例。如果您正苦于以下问题:C++ nsEudoraWin32::ImportAddresses方法的具体用法?C++ nsEudoraWin32::ImportAddresses怎么用?C++ nsEudoraWin32::ImportAddresses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsEudoraWin32
的用法示例。
在下文中一共展示了nsEudoraWin32::ImportAddresses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReportSuccess
NS_IMETHODIMP
ImportEudoraAddressImpl::ImportAddressBook(nsIImportABDescriptor *pSource,
nsIAddrDatabase *pDestination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
PRUnichar **pErrorLog,
PRUnichar **pSuccessLog,
bool *fatalError)
{
NS_PRECONDITION(pSource != nsnull, "null ptr");
NS_PRECONDITION(pDestination != nsnull, "null ptr");
NS_PRECONDITION(fatalError != nsnull, "null ptr");
nsString success;
nsString error;
if (!pSource || !pDestination || !fatalError) {
IMPORT_LOG0("*** Bad param passed to eudora address import\n");
nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ADDRESS_BADPARAM, error);
if (fatalError)
*fatalError = true;
ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
return NS_ERROR_NULL_POINTER;
}
bool abort = false;
nsString name;
pSource->GetPreferredName(name);
PRUint32 addressSize = 0;
pSource->GetSize(&addressSize);
if (addressSize == 0) {
IMPORT_LOG0("Address book size is 0, skipping mailbox.\n");
ReportSuccess(name, &success);
ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
return NS_OK;
}
nsCOMPtr<nsIFile> inFile;
if (NS_FAILED(pSource->GetAbFile(getter_AddRefs(inFile)))) {
ImportEudoraMailImpl::ReportError(EUDORAIMPORT_ADDRESS_BADSOURCEFILE, name, &error);
ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
return NS_ERROR_FAILURE;
}
#ifdef IMPORT_DEBUG
nsCString path;
inFile->GetNativePath(path);
IMPORT_LOG1("Import address book: %s\n", path.get());
#endif
nsresult rv = NS_OK;
m_bytes = 0;
rv = m_eudora.ImportAddresses(&m_bytes, &abort, name.get(), inFile, pDestination, error);
if (NS_SUCCEEDED(rv) && error.IsEmpty())
ReportSuccess(name, &success);
else
ImportEudoraMailImpl::ReportError(EUDORAIMPORT_ADDRESS_CONVERTERROR, name, &error);
ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
IMPORT_LOG0("*** Returning from eudora address import\n");
return rv;
}