本文整理汇总了C++中Address::country方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::country方法的具体用法?C++ Address::country怎么用?C++ Address::country使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::country方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addAddressValue
void VCardFormatImpl::addAddressValue( VCARD::VCard *vcard, const Address &a )
{
if ( a.isEmpty() )
return;
ContentLine cl;
cl.setName( EntityTypeToParamName( EntityAddress ) );
AdrValue *v = new AdrValue;
v->setPOBox( a.postOfficeBox().utf8() );
v->setExtAddress( a.extended().utf8() );
v->setStreet( a.street().utf8() );
v->setLocality( a.locality().utf8() );
v->setRegion( a.region().utf8() );
v->setPostCode( a.postalCode().utf8() );
v->setCountryName( a.country().utf8() );
cl.setValue( v );
addAddressParam( &cl, a.type() );
vcard->add( cl );
}
示例2: addresseeToLDIF
bool LDIFConverter::addresseeToLDIF( const Addressee &addr, QString &str )
{
if ( addr.isEmpty() )
return false;
QTextStream t( str, IO_WriteOnly|IO_Append );
t.setEncoding( QTextStream::UnicodeUTF8 );
const Address homeAddr = addr.address( Address::Home );
const Address workAddr = addr.address( Address::Work );
ldif_out( t, "dn", QString( "cn=%1,mail=%2" )
.arg( addr.formattedName().simplifyWhiteSpace() )
.arg( addr.preferredEmail() ) );
ldif_out( t, "givenname", addr.givenName() );
ldif_out( t, "sn", addr.familyName() );
ldif_out( t, "cn", addr.formattedName().simplifyWhiteSpace() );
ldif_out( t, "uid", addr.uid() );
ldif_out( t, "nickname", addr.nickName() );
ldif_out( t, "xmozillanickname", addr.nickName() );
ldif_out( t, "mail", addr.preferredEmail() );
if ( addr.emails().count() > 1 )
ldif_out( t, "mozillasecondemail", addr.emails()[ 1 ] );
//ldif_out( t, "mozilla_AIMScreenName: %1\n", "screen_name" );
ldif_out( t, "telephonenumber", addr.phoneNumber( PhoneNumber::Work ).number() );
ldif_out( t, "facsimiletelephonenumber", addr.phoneNumber( PhoneNumber::Fax ).number() );
ldif_out( t, "homephone", addr.phoneNumber( PhoneNumber::Home ).number() );
ldif_out( t, "mobile", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 7
ldif_out( t, "cellphone", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 4.x
ldif_out( t, "pager", addr.phoneNumber( PhoneNumber::Pager ).number() );
ldif_out( t, "pagerphone", addr.phoneNumber( PhoneNumber::Pager ).number() );
ldif_out( t, "streethomeaddress", homeAddr.street() );
ldif_out( t, "postalcode", workAddr.postalCode() );
ldif_out( t, "postofficebox", workAddr.postOfficeBox() );
QStringList streets = QStringList::split( '\n', homeAddr.street() );
if ( streets.count() > 0 )
ldif_out( t, "homepostaladdress", streets[ 0 ] ); // Netscape 7
if ( streets.count() > 1 )
ldif_out( t, "mozillahomepostaladdress2", streets[ 1 ] ); // Netscape 7
ldif_out( t, "mozillahomelocalityname", homeAddr.locality() ); // Netscape 7
ldif_out( t, "mozillahomestate", homeAddr.region() );
ldif_out( t, "mozillahomepostalcode", homeAddr.postalCode() );
ldif_out( t, "mozillahomecountryname", Address::ISOtoCountry(homeAddr.country()) );
ldif_out( t, "locality", workAddr.locality() );
ldif_out( t, "streetaddress", workAddr.street() ); // Netscape 4.x
streets = QStringList::split( '\n', workAddr.street() );
if ( streets.count() > 0 )
ldif_out( t, "postaladdress", streets[ 0 ] );
if ( streets.count() > 1 )
ldif_out( t, "mozillapostaladdress2", streets[ 1 ] );
ldif_out( t, "countryname", Address::ISOtoCountry(workAddr.country()) );
ldif_out( t, "l", workAddr.locality() );
ldif_out( t, "c", Address::ISOtoCountry(workAddr.country()) );
ldif_out( t, "st", workAddr.region() );
ldif_out( t, "title", addr.title() );
ldif_out( t, "vocation", addr.prefix() );
ldif_out( t, "ou", addr.role() );
ldif_out( t, "o", addr.organization() );
ldif_out( t, "organization", addr.organization() );
ldif_out( t, "organizationname", addr.organization() );
// Compatibility with older kabc versions.
if ( !addr.department().isEmpty() )
ldif_out( t, "department", addr.department() );
else
ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") );
ldif_out( t, "workurl", addr.url().prettyURL() );
ldif_out( t, "homeurl", addr.url().prettyURL() );
ldif_out( t, "description", addr.note() );
if (addr.revision().isValid())
ldif_out(t, "modifytimestamp", dateToVCardString( addr.revision()) );
t << "objectclass: top\n";
t << "objectclass: person\n";
t << "objectclass: organizationalPerson\n";
t << "\n";
return true;
}