本文整理汇总了C++中IMPORT_LOG1函数的典型用法代码示例。如果您正苦于以下问题:C++ IMPORT_LOG1函数的具体用法?C++ IMPORT_LOG1怎么用?C++ IMPORT_LOG1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IMPORT_LOG1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: smtpService
void nsEudoraWin32::SetSmtpServer( nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc, const char *pServer, const char *pUser)
{
nsresult rv;
nsCOMPtr<nsISmtpService> smtpService(do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv) && smtpService)
{
nsCOMPtr<nsISmtpServer> foundServer;
rv = smtpService->FindServer( pUser, pServer, getter_AddRefs( foundServer));
if (NS_SUCCEEDED( rv) && foundServer)
{
IMPORT_LOG1( "SMTP server already exists: %s\n", pServer);
return;
}
nsCOMPtr<nsISmtpServer> smtpServer;
rv = smtpService->CreateSmtpServer( getter_AddRefs( smtpServer));
if (NS_SUCCEEDED( rv) && smtpServer)
{
smtpServer->SetHostname( pServer);
if (pUser)
smtpServer->SetUsername( pUser);
IMPORT_LOG1( "Created new SMTP server: %s\n", pServer);
}
}
}
示例2: DumpAliasArray
void DumpAliasArray( nsVoidArray& a)
{
CAliasEntry *pEntry;
CAliasData *pData;
PRInt32 cnt = a.Count();
IMPORT_LOG1( "Alias list size: %ld\n", cnt);
for (PRInt32 i = 0; i < cnt; i++) {
pEntry = (CAliasEntry *)a.ElementAt( i);
IMPORT_LOG1( "\tAlias: %s\n", pEntry->m_name.get());
if (pEntry->m_list.Count() > 1) {
IMPORT_LOG1( "\tList count #%ld\n", pEntry->m_list.Count());
for (PRInt32 j = 0; j < pEntry->m_list.Count(); j++) {
pData = (CAliasData *) pEntry->m_list.ElementAt( j);
IMPORT_LOG0( "\t\t--------\n");
IMPORT_LOG1( "\t\temail: %s\n", pData->m_email.get());
IMPORT_LOG1( "\t\trealName: %s\n", pData->m_realName.get());
IMPORT_LOG1( "\t\tnickName: %s\n", pData->m_nickName.get());
}
}
else if (pEntry->m_list.Count()) {
pData = (CAliasData *) pEntry->m_list.ElementAt( 0);
IMPORT_LOG1( "\t\temail: %s\n", pData->m_email.get());
IMPORT_LOG1( "\t\trealName: %s\n", pData->m_realName.get());
IMPORT_LOG1( "\t\tnickName: %s\n", pData->m_nickName.get());
}
}
}
示例3: IMPORT_LOG0
void WMSettings::SetIdentities(nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc,
nsIDOMDocument *xmlDoc, nsAutoString &inUserName,
int32_t authMethodIncoming, bool isNNTP)
{
// Get the relevant information for an identity
// BUG 470587. Don't set this: id->SetIdentityName(fullName);
nsresult rv;
nsAutoString value;
nsCOMPtr<nsIMsgIdentity> id;
rv = pMgr->CreateIdentity(getter_AddRefs(id));
if (id) {
IMPORT_LOG0("Created identity and added to the account\n");
if (NS_SUCCEEDED(nsWMUtils::GetValueForTag(xmlDoc,
isNNTP ?
"NNTP_Display_Name" :
"SMTP_Display_Name",
value))) {
id->SetFullName(value);
IMPORT_LOG1("\tname: %S\n", value.get());
}
if (NS_SUCCEEDED(nsWMUtils::GetValueForTag(xmlDoc,
isNNTP ?
"NNTP_Organization_Name" :
"SMTP_Organization_Name",
value))) {
id->SetOrganization(value);
}
if (NS_SUCCEEDED(nsWMUtils::GetValueForTag(xmlDoc,
isNNTP ?
"NNTP_Email_Address" :
"SMTP_Email_Address",
value))) {
id->SetEmail(NS_ConvertUTF16toUTF8(value));
IMPORT_LOG1("\temail: %S\n", value.get());
}
if (NS_SUCCEEDED(nsWMUtils::GetValueForTag(xmlDoc,
isNNTP ?
"NNTP_Reply_To_Email_Address" :
"SMTP_Reply_To_Email_Address",
value))) {
id->SetReplyTo(NS_ConvertUTF16toUTF8(value));
}
// Windows users are used to top style quoting.
id->SetReplyOnTop(isNNTP ? 0 : 1);
pAcc->AddIdentity(id);
}
if (!isNNTP) // NNTP does not use SMTP in OE or TB
SetSmtpServer(xmlDoc, id, inUserName, authMethodIncoming);
}
示例4: do_QueryInterface
PRBool nsOEScanBoxes::Find50Mail( nsIFile *pWhere)
{
nsresult rv;
PRBool success = PR_FALSE;
HKEY sKey;
nsCOMPtr <nsILocalFile> localWhere = do_QueryInterface(pWhere);
if (::RegOpenKeyEx( HKEY_CURRENT_USER, "Identities", 0, KEY_QUERY_VALUE, &sKey) == ERROR_SUCCESS) {
BYTE * pBytes = nsOERegUtil::GetValueBytes( sKey, "Default User ID");
::RegCloseKey( sKey);
if (pBytes) {
nsCString key( "Identities\\");
key += (const char *)pBytes;
nsOERegUtil::FreeValueBytes( pBytes);
key += "\\Software\\Microsoft\\Outlook Express\\5.0";
if (::RegOpenKeyEx( HKEY_CURRENT_USER, key.get(), 0, KEY_QUERY_VALUE, &sKey) == ERROR_SUCCESS) {
pBytes = nsOERegUtil::GetValueBytes( sKey, "Store Root");
if (pBytes) {
localWhere->InitWithNativePath(nsDependentCString((const char *)pBytes));
IMPORT_LOG1( "Setting native path: %s\n", pBytes);
nsOERegUtil::FreeValueBytes( pBytes);
PRBool isDir = PR_FALSE;
rv = pWhere->IsDirectory( &isDir);
if (isDir && NS_SUCCEEDED( rv))
success = PR_TRUE;
}
::RegCloseKey( sKey);
}
}
}
return( success);
}
示例5: IMPORT_LOG1
nsresult nsOEAddressIterator::EnumUser(const char16_t * pName, LPENTRYID pEid, ULONG cbEid)
{
IMPORT_LOG1("User: %S\n", pName);
nsresult rv = NS_OK;
if (m_database) {
LPMAILUSER pUser = m_pWab->GetUser(cbEid, pEid);
if (pUser) {
// Get a new row from the database!
nsCOMPtr <nsIMdbRow> newRow;
rv = m_database->GetNewRow(getter_AddRefs(newRow));
NS_ENSURE_SUCCESS(rv, rv);
if (newRow && BuildCard(pName, newRow, pUser))
{
rv = m_database->AddCardRowToDB(newRow);
NS_ENSURE_SUCCESS(rv, rv);
IMPORT_LOG0("* Added entry to address book database\n");
nsString eMail;
LPSPropValue pProp = m_pWab->GetUserProperty(pUser, PR_EMAIL_ADDRESS);
if (pProp)
{
m_pWab->GetValueString(pProp, eMail);
SanitizeValue(eMail);
m_pWab->FreeProperty(pProp);
m_listRows.Put(eMail, newRow);
}
}
m_pWab->ReleaseUser(pUser);
}
}
return rv;
}
示例6: return
PRBool CImportMailbox::GetIndexFile( nsIFileSpec* file)
{
char *pLeaf = nsnull;
if (NS_FAILED( file->GetLeafName( &pLeaf)))
return( PR_FALSE);
PRInt32 len = strlen( pLeaf);
if (len < 5) {
nsCRT::free( pLeaf);
return( PR_FALSE);
}
pLeaf[len - 1] = 'x';
pLeaf[len - 2] = 'd';
pLeaf[len - 3] = 'i';
IMPORT_LOG1( "Looking for index leaf name: %s\n", pLeaf);
nsresult rv;
rv = file->SetLeafName( pLeaf);
nsCRT::free( pLeaf);
PRBool isFile = PR_FALSE;
PRBool exists = PR_FALSE;
if (NS_SUCCEEDED( rv)) rv = file->IsFile( &isFile);
if (NS_SUCCEEDED( rv)) rv = file->Exists( &exists);
if (isFile && exists)
return( PR_TRUE);
else
return( PR_FALSE);
}
示例7: IMPORT_LOG1
PRBool nsOEScanBoxes::GetMailboxes( nsIFile *pWhere, nsISupportsArray **pArray)
{
nsCString path;
pWhere->GetNativePath(path);
if (!path.IsEmpty()) {
IMPORT_LOG1( "Looking for mail in: %s\n", path.get());
}
else {
pWhere->GetNativeLeafName(path);
if (!path.IsEmpty())
IMPORT_LOG1( "Looking for mail in: %s\n", path.get());
else
IMPORT_LOG0( "Unable to get info about where to look for mail\n");
}
nsCOMPtr <nsIFile> location;
pWhere->Clone(getter_AddRefs(location));
// 1. Look for 5.0 folders.dbx
// 2. Look for 3.x & 4.x folders.nch
// 3. Look for 5.0 *.dbx mailboxes
// 4. Look for 3.x & 4.x *.mbx mailboxes
PRBool result;
location->AppendNative(NS_LITERAL_CSTRING("folders.dbx"));
if (Find50MailBoxes(location)) {
result = GetMailboxList( location, pArray);
}
else {
// 2. Look for 4.x mailboxes
location->AppendNative(NS_LITERAL_CSTRING("folders.nch"));
if (FindMailBoxes(location)) {
result = GetMailboxList( location, pArray);
}
else {
// 3 & 4, look for the specific mailbox files.
pWhere->Clone(getter_AddRefs(location));
ScanMailboxDir( location);
result = GetMailboxList( location, pArray);
}
}
return( result);
}
示例8: IMPORT_LOG0
PRBool CImportMailbox::ImportMailbox( PRUint32 *pDone, PRBool *pAbort, nsString& name, nsIFileSpec * inFile, nsIFileSpec * outFile, PRUint32 *pCount)
{
PRBool done = PR_FALSE;
nsIFileSpec *idxFile;
if (NS_FAILED( NS_NewFileSpec( &idxFile))) {
IMPORT_LOG0( "New file spec failed!\n");
return( PR_FALSE);
}
idxFile->FromFileSpec( inFile);
if (GetIndexFile( idxFile)) {
IMPORT_LOG1( "Using index file for: %S\n", name.get());
CIndexScanner *pIdxScanner = new CIndexScanner( name, idxFile, inFile, outFile);
if (pIdxScanner->Initialize()) {
if (pIdxScanner->DoWork( pAbort, pDone, pCount)) {
done = PR_TRUE;
}
else {
IMPORT_LOG0( "CIndexScanner::DoWork() failed\n");
}
}
else {
IMPORT_LOG0( "CIndexScanner::Initialize() failed\n");
}
delete pIdxScanner;
}
idxFile->Release();
if (done)
return( done);
/*
something went wrong with the index file, just scan the mailbox
file itself.
*/
CMbxScanner *pMbx = new CMbxScanner( name, inFile, outFile);
if (pMbx->Initialize()) {
if (pMbx->DoWork( pAbort, pDone, pCount)) {
done = PR_TRUE;
}
else {
IMPORT_LOG0( "CMbxScanner::DoWork() failed\n");
}
}
else {
IMPORT_LOG0( "CMbxScanner::Initialize() failed\n");
}
delete pMbx;
return( done);
}
示例9: GetServerAndUserName
PRBool nsEudoraWin32::BuildIMAPAccount( nsIMsgAccountManager *accMgr, const char *pSection, const char *pIni, nsIMsgAccount **ppAccount)
{
char valBuff[kIniValueSize];
nsCString serverName;
nsCString userName;
GetServerAndUserName( pSection, pIni, serverName, userName, valBuff);
if (serverName.IsEmpty() || userName.IsEmpty())
return( PR_FALSE);
PRBool result = PR_FALSE;
nsCOMPtr<nsIMsgIncomingServer> in;
nsresult rv = accMgr->FindServer( userName, serverName, NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
if (NS_FAILED( rv) || (in == nsnull))
{
// Create the incoming server and an account for it?
rv = accMgr->CreateIncomingServer( userName, serverName, NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
if (NS_SUCCEEDED( rv) && in)
{
rv = in->SetType(NS_LITERAL_CSTRING("imap"));
// rv = in->SetHostName( serverName);
// rv = in->SetUsername( userName);
IMPORT_LOG2( "Created IMAP server named: %s, userName: %s\n", serverName.get(), userName.get());
nsString prettyName;
GetAccountName( pSection, prettyName);
IMPORT_LOG1( "\tSet pretty name to: %S\n", prettyName.get());
rv = in->SetPrettyName(prettyName);
// We have a server, create an account.
nsCOMPtr<nsIMsgAccount> account;
rv = accMgr->CreateAccount( getter_AddRefs( account));
if (NS_SUCCEEDED( rv) && account)
{
rv = account->SetIncomingServer(in);
IMPORT_LOG0( "Created an account and set the IMAP server as the incoming server\n");
// Fiddle with the identities
SetIdentities(accMgr, account, pSection, pIni, userName.get(), serverName.get(), valBuff);
result = PR_TRUE;
if (ppAccount)
account->QueryInterface( NS_GET_IID(nsIMsgAccount), (void **)ppAccount);
}
}
}
else
result = PR_TRUE;
return( result);
}
示例10: getter_AddRefs
void nsEudoraWin32::SetIdentities(nsIMsgAccountManager *accMgr, nsIMsgAccount *acc, const char *pSection, const char *pIniFile, const char *userName, const char *serverName, char *pBuff)
{
nsCAutoString realName;
nsCAutoString email;
nsCAutoString server;
DWORD valSize;
nsresult rv;
valSize = ::GetPrivateProfileString( pSection, "RealName", "", pBuff, kIniValueSize, pIniFile);
if (valSize)
realName = pBuff;
valSize = ::GetPrivateProfileString( pSection, "SMTPServer", "", pBuff, kIniValueSize, pIniFile);
if (valSize)
server = pBuff;
valSize = ::GetPrivateProfileString( pSection, "ReturnAddress", "", pBuff, kIniValueSize, pIniFile);
if (valSize)
email = pBuff;
nsCOMPtr<nsIMsgIdentity> id;
rv = accMgr->CreateIdentity( getter_AddRefs( id));
if (id)
{
nsAutoString fullName;
fullName.Assign(NS_ConvertASCIItoUTF16(realName));
id->SetFullName(fullName);
id->SetIdentityName(fullName);
if (email.IsEmpty())
{
email = userName;
email += "@";
email += serverName;
}
id->SetEmail(email);
acc->AddIdentity( id);
IMPORT_LOG0( "Created identity and added to the account\n");
IMPORT_LOG1( "\tname: %s\n", realName.get());
IMPORT_LOG1( "\temail: %s\n", email.get());
}
SetSmtpServer( accMgr, acc, server.get(), userName);
}
示例11: DUMP_FILENAME
void DUMP_FILENAME(nsIFile *pFile, bool endLine)
{
nsCString pPath;
if (pFile)
pFile->GetNativePath(pPath);
if (!pPath.IsEmpty())
IMPORT_LOG1("%s", pPath.get());
else
IMPORT_LOG0("Unknown");
if (endLine)
IMPORT_LOG0("\n");
}
示例12: NS_CopyNativeToUnicode
nsresult nsEudoraWin32::FoundMailbox( nsIFile *mailFile, const char *pName, nsISupportsArray *pArray, nsIImportService *pImport)
{
nsString displayName;
nsCOMPtr<nsIImportMailboxDescriptor> desc;
nsISupports * pInterface;
NS_CopyNativeToUnicode(nsDependentCString(pName), displayName);
#ifdef IMPORT_DEBUG
nsCAutoString path;
mailFile->GetNativePath(path);
if (!path.IsEmpty())
IMPORT_LOG2( "Found eudora mailbox, %s: %s\n", path.get(), pName);
else
IMPORT_LOG1( "Found eudora mailbox, %s\n", pName);
IMPORT_LOG1( "\tm_depth = %d\n", (int)m_depth);
#endif
nsresult rv = pImport->CreateNewMailboxDescriptor( getter_AddRefs( desc));
if (NS_SUCCEEDED( rv))
{
PRInt64 sz = 0;
mailFile->GetFileSize( &sz);
desc->SetDisplayName( displayName.get());
desc->SetDepth( m_depth);
desc->SetSize( sz);
nsCOMPtr <nsILocalFile> pFile = nsnull;
desc->GetFile(getter_AddRefs(pFile));
if (pFile)
{
nsCOMPtr <nsILocalFile> localMailFile = do_QueryInterface(mailFile);
pFile->InitWithFile( localMailFile);
}
rv = desc->QueryInterface( kISupportsIID, (void **) &pInterface);
pArray->AppendElement( pInterface);
pInterface->Release();
}
return( NS_OK);
}
示例13: sizeof
PRBool CMbxScanner::WriteMailItem( PRUint32 flags, PRUint32 offset, PRUint32 size, PRUint32 *pTotalMsgSize)
{
PRUint32 values[kNumMbxLongsToRead];
PRInt32 cnt = kNumMbxLongsToRead * sizeof( PRUint32);
nsresult rv;
PRBool failed = PR_FALSE;
PRInt32 cntRead;
PRInt8 * pChar = (PRInt8 *) values;
rv = m_mbxFile->Seek( offset);
m_mbxFile->Failed( &failed);
if (NS_FAILED( rv) || failed) {
IMPORT_LOG1( "Mbx seek error: 0x%lx\n", offset);
return( PR_FALSE);
}
rv = m_mbxFile->Read( (char **) &pChar, cnt, &cntRead);
if (NS_FAILED( rv) || (cntRead != cnt)) {
IMPORT_LOG1( "Mbx read error at: 0x%lx\n", offset);
return( PR_FALSE);
}
if (values[0] != 0x7F007F00) {
IMPORT_LOG2( "Mbx tag field doesn't match: 0x%lx, at offset: 0x%lx\n", values[0], offset);
return( PR_FALSE);
}
if (size && (values[2] != size)) {
IMPORT_LOG3( "Mbx size doesn't match idx, mbx: %ld, idx: %ld, at offset: 0x%lx\n", values[2], size, offset);
return( PR_FALSE);
}
if (pTotalMsgSize != nsnull)
*pTotalMsgSize = values[2];
// everything looks kosher...
// the actual message text follows and is values[3] bytes long...
return( CopyMbxFileBytes(flags, values[3]));
}
示例14: IMPORT_LOG0
/*
This is where the real work happens!
Go through the field map and set the data in a new database row
*/
nsresult nsTextAddress::ProcessLine(const nsAString &aLine, nsString& errors)
{
if (!m_fieldMap) {
IMPORT_LOG0("*** Error, text import needs a field map\n");
return NS_ERROR_FAILURE;
}
nsresult rv;
// Wait until we get our first non-empty field, then create a new row,
// fill in the data, then add the row to the database.
nsCOMPtr<nsIMdbRow> newRow;
nsAutoString fieldVal;
int32_t fieldNum;
int32_t numFields = 0;
bool active;
rv = m_fieldMap->GetMapSize(&numFields);
for (int32_t i = 0; (i < numFields) && NS_SUCCEEDED(rv); i++) {
active = false;
rv = m_fieldMap->GetFieldMap(i, &fieldNum);
if (NS_SUCCEEDED(rv))
rv = m_fieldMap->GetFieldActive(i, &active);
if (NS_SUCCEEDED(rv) && active) {
if (GetField(aLine, i, fieldVal, m_delim)) {
if (!fieldVal.IsEmpty()) {
if (!newRow) {
rv = m_database->GetNewRow(getter_AddRefs(newRow));
if (NS_FAILED(rv)) {
IMPORT_LOG0("*** Error getting new address database row\n");
}
}
if (newRow) {
rv = m_fieldMap->SetFieldValue(m_database, newRow, fieldNum, fieldVal.get());
}
}
}
else
break;
}
else if (active) {
IMPORT_LOG1("*** Error getting field map for index %ld\n", (long) i);
}
}
if (NS_SUCCEEDED(rv) && newRow)
rv = m_database->AddCardRowToDB(newRow);
return rv;
}
示例15: IMPORT_LOG1
bool nsEudoraMailbox::AddAttachment(nsCString& fileName)
{
IMPORT_LOG1("Found attachment: %s\n", fileName.get());
nsresult rv;
nsCOMPtr <nsIFile> pFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_FAILED(rv))
return false;
nsCString mimeType;
nsCString attachmentName;
if (NS_FAILED(GetAttachmentInfo(fileName.get(), pFile, mimeType, attachmentName)))
return false;
ImportAttachment *a = new ImportAttachment;
a->mimeType = ToNewCString(mimeType);
a->description = !attachmentName.IsEmpty() ? ToNewCString(attachmentName) : strdup("Attached File");
a->pAttachment = pFile;
m_attachments.AppendElement(a);
return true;
}