本文整理汇总了C++中addressee::List::constEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ List::constEnd方法的具体用法?C++ List::constEnd怎么用?C++ List::constEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addressee::List
的用法示例。
在下文中一共展示了List::constEnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char **argv )
{
KAboutData aboutData( "testkabcdlg", 0, ki18n( "TestKabc" ), "0.1" );
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineOptions options;
options.add( "multiple", ki18n( "Allow selection of multiple addressees" ) );
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if ( args->isSet( "multiple" ) ) {
Addressee::List al = AddresseeDialog::getAddressees( 0 );
Addressee::List::ConstIterator it;
kDebug() << "Selected Addressees:";
for ( it = al.constBegin(); it != al.constEnd(); ++it ) {
kDebug() << " " << ( *it ).fullEmail();
}
} else {
Addressee a = AddresseeDialog::getAddressee( 0 );
if ( !a.isEmpty() ) {
kDebug() << "Selected Addressee:";
kDebug() << a.toString();
} else {
kDebug() << "No Addressee selected.";
}
}
}
示例2: createVCards
// TODO: make list a const&
QString VCardTool::createVCards(Addressee::List list, VCard::Version version)
{
VCard::List vCardList;
Addressee::List::ConstIterator addrIt;
Addressee::List::ConstIterator listEnd(list.constEnd());
for(addrIt = list.constBegin(); addrIt != listEnd; ++addrIt)
{
VCard card;
QStringList::ConstIterator strIt;
// ADR + LABEL
const Address::List addresses = (*addrIt).addresses();
for(Address::List::ConstIterator it = addresses.begin(); it != addresses.end(); ++it)
{
QStringList address;
bool isEmpty = ((*it).postOfficeBox().isEmpty() && (*it).extended().isEmpty() && (*it).street().isEmpty() && (*it).locality().isEmpty()
&& (*it).region().isEmpty() && (*it).postalCode().isEmpty() && (*it).country().isEmpty());
address.append((*it).postOfficeBox().replace(';', "\\;"));
address.append((*it).extended().replace(';', "\\;"));
address.append((*it).street().replace(';', "\\;"));
address.append((*it).locality().replace(';', "\\;"));
address.append((*it).region().replace(';', "\\;"));
address.append((*it).postalCode().replace(';', "\\;"));
address.append((*it).country().replace(';', "\\;"));
VCardLine adrLine("ADR", address.join(";"));
if(version == VCard::v2_1 && needsEncoding(address.join(";")))
{
adrLine.addParameter("charset", "UTF-8");
adrLine.addParameter("encoding", "QUOTED-PRINTABLE");
}
VCardLine labelLine("LABEL", (*it).label());
if(version == VCard::v2_1 && needsEncoding((*it).label()))
{
labelLine.addParameter("charset", "UTF-8");
labelLine.addParameter("encoding", "QUOTED-PRINTABLE");
}
bool hasLabel = !(*it).label().isEmpty();
QMap< QString, int >::ConstIterator typeIt;
for(typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt)
{
if(typeIt.data() & (*it).type())
{
adrLine.addParameter("TYPE", typeIt.key());
if(hasLabel)
labelLine.addParameter("TYPE", typeIt.key());
}
}
if(!isEmpty)
card.addLine(adrLine);
if(hasLabel)
card.addLine(labelLine);
}
// AGENT
card.addLine(createAgent(version, (*addrIt).agent()));
// BDAY
card.addLine(VCardLine("BDAY", createDateTime((*addrIt).birthday())));
// CATEGORIES
if(version == VCard::v3_0)
{
QStringList categories = (*addrIt).categories();
QStringList::Iterator catIt;
for(catIt = categories.begin(); catIt != categories.end(); ++catIt)
(*catIt).replace(',', "\\,");
VCardLine catLine("CATEGORIES", categories.join(","));
if(version == VCard::v2_1 && needsEncoding(categories.join(",")))
{
catLine.addParameter("charset", "UTF-8");
catLine.addParameter("encoding", "QUOTED-PRINTABLE");
}
card.addLine(catLine);
}
// CLASS
if(version == VCard::v3_0)
{
card.addLine(createSecrecy((*addrIt).secrecy()));
}
// EMAIL
const QStringList emails = (*addrIt).emails();
bool pref = true;
for(strIt = emails.begin(); strIt != emails.end(); ++strIt)
{
VCardLine line("EMAIL", *strIt);
if(pref == true && emails.count() > 1)
{
line.addParameter("TYPE", "PREF");
//.........这里部分代码省略.........