本文整理汇总了C++中MojString::compareCaseless方法的典型用法代码示例。如果您正苦于以下问题:C++ MojString::compareCaseless方法的具体用法?C++ MojString::compareCaseless怎么用?C++ MojString::compareCaseless使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MojString
的用法示例。
在下文中一共展示了MojString::compareCaseless方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseRecipients
void EmailAdapter::ParseRecipients(const MojObject& recipients, Email& email)
{
MojErr err;
EmailAddressListPtr to_list(new EmailAddressList);
EmailAddressListPtr cc_list(new EmailAddressList);
EmailAddressListPtr bcc_list(new EmailAddressList);
MojObject::ConstArrayIterator it = recipients.arrayBegin();
for (; it != recipients.arrayEnd(); ++it) {
const MojObject& recipient = *it;
MojString type;
err = recipient.getRequired(Part::TYPE, type);
ErrorToException(err);
EmailAddressPtr addr = ParseAddress(recipient);
if(type.compareCaseless("to") == 0)
to_list->push_back(addr);
else if(type.compareCaseless("cc") == 0)
cc_list->push_back(addr);
else if(type.compareCaseless("bcc") == 0)
bcc_list->push_back(addr);
else // not a valid recipient type
throw MailException("invalid recipient type", __FILE__, __LINE__);
}
email.SetTo(to_list);
email.SetCc(cc_list);
email.SetBcc(bcc_list);
}