本文整理汇总了C++中boost::shared_ptr::GetAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::GetAddress方法的具体用法?C++ shared_ptr::GetAddress怎么用?C++ shared_ptr::GetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::GetAddress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
PreSaveLimitationsCheck::CheckLimitations(boost::shared_ptr<DistributionListRecipient> recipient, String &resultDescription)
{
if (recipient->GetAddress().GetLength() == 0)
{
resultDescription = "The recipient address is empty";
return false;
}
return true;
}
示例2:
bool
PersistentTCPIPPort::SaveObject(boost::shared_ptr<TCPIPPort> pObject)
{
SQLStatement oStatement;
oStatement.SetTable("hm_tcpipports");
if (pObject->GetID() == 0)
{
oStatement.SetStatementType(SQLStatement::STInsert);
oStatement.SetIdentityColumn("portid");
}
else
{
oStatement.SetStatementType(SQLStatement::STUpdate);
String sWhere;
sWhere.Format(_T("portid = %I64d"), pObject->GetID());
oStatement.SetWhereClause(sWhere);
}
__int64 iAddress = 0;
IPAddressSQLHelper helper;
oStatement.AddColumn("portprotocol", pObject->GetProtocol());
oStatement.AddColumn("portnumber", pObject->GetPortNumber());
oStatement.AddColumnInt64("portsslcertificateid", pObject->GetSSLCertificateID());
helper.AppendStatement(oStatement, pObject->GetAddress(), "portaddress1", "portaddress2");
oStatement.AddColumn("portusessl", pObject->GetUseSSL());
bool bNewObject = pObject->GetID() == 0;
// Save and fetch ID
__int64 iDBID = 0;
bool bRetVal = Application::Instance()->GetDBManager()->Execute(oStatement, bNewObject ? &iDBID : 0);
if (bRetVal && bNewObject)
pObject->SetID((int) iDBID);
return true;
}
示例3: DuplicateError
bool
PreSaveLimitationsCheck::CheckLimitations(boost::shared_ptr<DistributionList> list, String &resultDescription)
{
boost::shared_ptr<Domain> domain = GetDomain(list->GetDomainID());
if (GetDuplicateExist(domain, TypeList,list->GetID(), list->GetAddress()))
return DuplicateError(resultDescription);
if (list->GetID() == 0)
{
if (domain->GetMaxNoOfDistributionLists() &&
domain->GetDistributionLists()->GetCount() >= domain->GetMaxNoOfDistributionLists())
{
resultDescription = "The maximum number of distribution lists have been created.";
return false;
}
}
return true;
}
示例4: deleteCommand
bool
PersistentAccount::DeleteObject(boost::shared_ptr<Account> pAccount)
{
__int64 iID = pAccount->GetID();
assert(iID);
if (iID <= 0)
return false;
// Delete messages connected to this account.
DeleteMessages(pAccount);
// Force delete the inbox as well. DeleteMessages above does not delete it.
boost::shared_ptr<IMAPFolder> inbox = pAccount->GetFolders()->GetFolderByName("Inbox");
if (inbox)
PersistentIMAPFolder::DeleteObject(inbox, true);
pAccount->GetRules()->DeleteAll();
// Delete fetch accounts connected to this account.
PersistentFetchAccount::DeleteByAccountID(iID);
// Delete references from groups...
PersistentGroupMember::DeleteByAccount(iID);
PersistentACLPermission::DeleteOwnedByAccount(iID);
SQLCommand deleteCommand("delete from hm_accounts where accountid = @ACCOUNTID");
deleteCommand.AddParameter("@ACCOUNTID", iID);
bool bRet = Application::Instance()->GetDBManager()->Execute(deleteCommand);
// Delete folder from data directory
String sAccountFolder = IniFileSettings::Instance()->GetDataDirectory() + "\\" + StringParser::ExtractDomain(pAccount->GetAddress()) + "\\" + StringParser::ExtractAddress(pAccount->GetAddress());
FileUtilities::DeleteDirectory(sAccountFolder);
// Refresh caches.
Cache<Account, PersistentAccount>::Instance()->RemoveObject(pAccount);
return bRet;
}
示例5: Account
bool
PersistentAccount::SaveObject(boost::shared_ptr<Account> pAccount, String &sErrorMessage, bool createInbox)
{
if (!PreSaveLimitationsCheck::CheckLimitations(pAccount, sErrorMessage))
return false;
__int64 iID = pAccount->GetID();
if (iID > 0)
{
// First read the domain to see if we've changed its name.
boost::shared_ptr<Account> tempAccount = boost::shared_ptr<Account>(new Account());
if (!PersistentAccount::ReadObject(tempAccount, iID))
return false;
if (tempAccount->GetAddress().CompareNoCase(pAccount->GetAddress()) != 0)
{
// Check if this account contains messages with full path. If so, the user cannot
// rename it at this point.
// Disallow change, if not all files are partial in the database.
if (!PersistentMessage::GetAllMessageFilesArePartialNames())
{
sErrorMessage = "As of hMailServer 5.4, partial file names are stored in the database, rather than the full path\r\n"
"To be able to rename the account, you must first migrate your database to the new partial paths scheme. To do\r\n"
"this, run Data Directory Synchronizer.";
return false;
}
// Name has been changed. Rename all sub objects first.
NameChanger nameChanger;
if (!nameChanger.RenameAccount(tempAccount->GetAddress(), pAccount, sErrorMessage))
return false;
// Remove the old account from the cache.
Cache<Account, PersistentAccount>::Instance()->RemoveObject(tempAccount->GetAddress());
}
}
SQLStatement oStatement;
oStatement.AddColumnInt64("accountdomainid", pAccount->GetDomainID());
oStatement.AddColumn("accountaddress", pAccount->GetAddress());
oStatement.AddColumn("accountpassword", pAccount->GetPassword());
oStatement.AddColumn("accountactive", pAccount->GetActive());
oStatement.AddColumn("accountisad", pAccount->GetIsAD());
oStatement.AddColumn("accountaddomain", pAccount->GetADDomain());
oStatement.AddColumn("accountadusername", pAccount->GetADUsername());
oStatement.AddColumn("accountmaxsize", pAccount->GetAccountMaxSize());
oStatement.AddColumn("accountvacationmessageon", pAccount->GetVacationMessageIsOn());
oStatement.AddColumn("accountvacationmessage", pAccount->GetVacationMessage());
oStatement.AddColumn("accountvacationsubject", pAccount->GetVacationSubject());
oStatement.AddColumn("accountvacationexpires", pAccount->GetVacationExpires());
oStatement.AddColumn("accountvacationexpiredate", pAccount->GetVacationExpiresDate());
oStatement.AddColumn("accountpwencryption", pAccount->GetPasswordEncryption());
oStatement.AddColumn("accountadminlevel", pAccount->GetAdminLevel());
oStatement.AddColumn("accountforwardenabled", pAccount->GetForwardEnabled());
oStatement.AddColumn("accountforwardaddress", pAccount->GetForwardAddress());
oStatement.AddColumn("accountforwardkeeporiginal", pAccount->GetForwardKeepOriginal());
oStatement.AddColumn("accountenablesignature", pAccount->GetEnableSignature());
oStatement.AddColumn("accountsignatureplaintext", pAccount->GetSignaturePlainText());
oStatement.AddColumn("accountsignaturehtml", pAccount->GetSignatureHTML());
oStatement.AddColumn("accountlastlogontime", pAccount->GetLastLogonTime());
oStatement.AddColumn("accountpersonfirstname", pAccount->GetPersonFirstName());
oStatement.AddColumn("accountpersonlastname", pAccount->GetPersonLastName());
oStatement.SetTable("hm_accounts");
if (pAccount->GetID() == 0)
{
oStatement.SetStatementType(SQLStatement::STInsert);
oStatement.SetIdentityColumn("accountid");
}
else
{
oStatement.SetStatementType(SQLStatement::STUpdate);
String sWhere;
sWhere.Format(_T("accountid = %I64d"), pAccount->GetID());
oStatement.SetWhereClause(sWhere);
}
bool bNewObject = pAccount->GetID() == 0;
// Save and fetch ID
__int64 iDBID = 0;
bool bRetVal = Application::Instance()->GetDBManager()->Execute(oStatement, bNewObject ? &iDBID : 0);
if (bRetVal && bNewObject)
{
pAccount->SetID((long) iDBID);
if (createInbox)
{
if (!CreateInbox(*pAccount))
//.........这里部分代码省略.........