本文整理汇总了C++中nsEudoraWin32类的典型用法代码示例。如果您正苦于以下问题:C++ nsEudoraWin32类的具体用法?C++ nsEudoraWin32怎么用?C++ nsEudoraWin32使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nsEudoraWin32类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetDefaultLocation
NS_IMETHODIMP ImportEudoraAddressImpl::GetDefaultLocation(nsIFile **ppLoc, bool *found, bool *userVerify)
{
NS_PRECONDITION(found != nsnull, "null ptr");
NS_PRECONDITION(ppLoc != nsnull, "null ptr");
NS_PRECONDITION(userVerify != nsnull, "null ptr");
if (! found || !userVerify || !ppLoc)
return NS_ERROR_NULL_POINTER;
*ppLoc = nsnull;
*found = m_eudora.FindAddressFolder(ppLoc);
*userVerify = true;
return NS_OK;
}
开发者ID:,项目名称:,代码行数:14,代码来源:
示例2: FindAddressBooks
NS_IMETHODIMP ImportEudoraAddressImpl::FindAddressBooks(nsIFile *pLoc, nsISupportsArray **ppArray)
{
NS_PRECONDITION(pLoc != nsnull, "null ptr");
NS_PRECONDITION(ppArray != nsnull, "null ptr");
if (!pLoc || !ppArray)
return NS_ERROR_NULL_POINTER;
bool exists = false;
nsresult rv = pLoc->Exists(&exists);
if (NS_FAILED(rv) || !exists)
return NS_ERROR_FAILURE;
rv = m_eudora.FindAddressBooks(pLoc, ppArray);
if (NS_FAILED(rv) && *ppArray)
NS_RELEASE(*ppArray);
return rv;
}
开发者ID:,项目名称:,代码行数:18,代码来源:
示例3: FindMailboxes
NS_IMETHODIMP ImportEudoraMailImpl::FindMailboxes( nsIFile *pLoc, nsISupportsArray **ppArray)
{
NS_PRECONDITION(pLoc != nsnull, "null ptr");
NS_PRECONDITION(ppArray != nsnull, "null ptr");
if (!pLoc || !ppArray)
return NS_ERROR_NULL_POINTER;
PRBool exists = PR_FALSE;
nsresult rv = pLoc->Exists( &exists);
if (NS_FAILED( rv) || !exists)
return( NS_ERROR_FAILURE);
rv = m_eudora.FindMailboxes( pLoc, ppArray);
if (NS_FAILED( rv) && *ppArray)
{
NS_RELEASE( *ppArray);
*ppArray = nsnull;
}
return( rv);
}
开发者ID:,项目名称:,代码行数:21,代码来源:
示例4: 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;
}
开发者ID:,项目名称:,代码行数:69,代码来源:
示例5: ImportMailbox
NS_IMETHODIMP ImportEudoraMailImpl::ImportMailbox(nsIImportMailboxDescriptor *pSource,
nsIFile *pDestination,
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 mailbox import\n");
nsEudoraStringBundle::GetStringByID( EUDORAIMPORT_MAILBOX_BADPARAM, error);
if (fatalError)
*fatalError = true;
SetLogs( success, error, pErrorLog, pSuccessLog);
return NS_ERROR_NULL_POINTER;
}
bool abort = false;
nsString name;
PRUnichar * pName;
if (NS_SUCCEEDED( pSource->GetDisplayName( &pName)))
{
name = pName;
NS_Free( pName);
}
PRUint32 mailSize = 0;
pSource->GetSize( &mailSize);
if (mailSize == 0)
{
IMPORT_LOG0( "Mailbox size is 0, skipping mailbox.\n");
ReportSuccess( name, 0, &success);
SetLogs( success, error, pErrorLog, pSuccessLog);
return( NS_OK);
}
nsCOMPtr <nsILocalFile> inFile;
if (NS_FAILED(pSource->GetFile( getter_AddRefs(inFile))))
{
ReportError( EUDORAIMPORT_MAILBOX_BADSOURCEFILE, name, &error);
SetLogs( success, error, pErrorLog, pSuccessLog);
return( NS_ERROR_FAILURE);
}
#ifdef IMPORT_DEBUG
nsCString pPath;
inFile->GetNativePath(pPath);
IMPORT_LOG1( "Import mailbox: %s\n", pPath.get());
#endif
PRInt32 msgCount = 0;
nsresult rv = NS_OK;
m_bytes = 0;
rv = m_eudora.ImportMailbox( &m_bytes, &abort, name.get(), inFile, pDestination, &msgCount);
if (NS_SUCCEEDED( rv))
ReportSuccess( name, msgCount, &success);
else
ReportError( EUDORAIMPORT_MAILBOX_CONVERTERROR, name, &error);
SetLogs( success, error, pErrorLog, pSuccessLog);
IMPORT_LOG0( "*** Returning from eudora mailbox import\n");
return( rv);
}
开发者ID:vanto,项目名称:comm-central,代码行数:73,代码来源:nsEudoraImport.cpp
注:本文中的nsEudoraWin32类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论