kabc Library API Documentation

KABC::LDIFConverter Namespace Reference

A set of functions to convert a string with LDIF information to addressees and vice versa. More...


Functions

KABC_EXPORT bool LDIFToAddressee (const QString &str, AddresseeList &addrList, QDateTime dt=QDateTime::currentDateTime())
KABC_EXPORT bool addresseeToLDIF (const AddresseeList &addrList, QString &str)
KABC_EXPORT bool addresseeToLDIF (const Addressee &addr, QString &str)
KABC_EXPORT QString makeLDIFfieldString (QString field, QString value, bool allowEncode=true) KDE_DEPRECATED
KABC_EXPORT bool parseSingleLine (Addressee &a, Address &homeAddr, Address &workAddr, QString &line)
KABC_EXPORT bool splitLine (QString &line, QString &fieldname, QString &value)
KABC_EXPORT bool evaluatePair (Addressee &a, Address &homeAddr, Address &workAddr, QString &fieldname, QString &value)


Detailed Description

A set of functions to convert a string with LDIF information to addressees and vice versa.

It is useful for addressbook import- and exportfilters and might be used to read and write Mozilla and Netscape addresssbooks.


Function Documentation

bool KABC::LDIFConverter::LDIFToAddressee const QString str,
AddresseeList addrList,
QDateTime  dt = QDateTime::currentDateTime()
 

Converts a LDIF string to a list of addressees.

Parameters:
str The vcard string.
addrList The addresseelist.
dt The date & time value of the last modification (e.g. file modification time).
Since:
3.2

Definition at line 163 of file ldifconverter.cpp.

References QValueList::append(), KABC::LDIF::attr(), QDateTime::currentDateTime(), KABC::LDIF::endLDIF(), evaluatePair(), QString::fromUtf8(), KABC::Address::isEmpty(), QString::isEmpty(), QDateTime::isValid(), QString::latin1(), QString::lower(), KABC::LDIF::nextItem(), KABC::LDIF::setLDIF(), and KABC::LDIF::val().

bool KABC::LDIFConverter::addresseeToLDIF const AddresseeList addrList,
QString str
 

Converts a list of addressees to a LDIF string.

Parameters:
addrList The addresseelist.
str The LDIF string.
Since:
3.2

Definition at line 56 of file ldifconverter.cpp.

References QValueList::begin(), QValueList< Addressee >::ConstIterator(), and QValueList::end().

bool KABC::LDIFConverter::addresseeToLDIF const Addressee addr,
QString str
 

Converts an addressee to a LDIF string.

Parameters:
addr The addressee.
str The LDIF string.
Since:
3.2

Definition at line 78 of file ldifconverter.cpp.

References KABC::Address::country(), KABC::dateToVCardString(), KABC::Address::ISOtoCountry(), KABC::Address::locality(), KABC::Address::postalCode(), KABC::Address::postOfficeBox(), KABC::Address::region(), QTextStream::setEncoding(), QStringList::split(), and KABC::Address::street().

QString KABC::LDIFConverter::makeLDIFfieldString QString  field,
QString  value,
bool  allowEncode = true
 

Deprecated:
Obsoleted - please use LDIF::assembleLine() Returns a LDIF compatible string representing a given field/value pair.
If necessary, the value parameter will be base64encoded and split into multiple. This function will return an empty string if the given value is empty.

Parameters:
field The LDAP field name or a complete LDIF field string (e.g. "cn" or "cn = %1\n").
value The value for this field.
allowEncode Set to false if you wish no encoding of the value.
Since:
3.2

Definition at line 519 of file ldifconverter.cpp.

References QString::append(), QString::arg(), KCodecs::base64Encode(), QString::find(), QString::fromUtf8(), QCString::insert(), QString::insert(), QString::isEmpty(), QCString::length(), QString::length(), and QString::utf8().

bool KABC::LDIFConverter::parseSingleLine Addressee a,
Address homeAddr,
Address workAddr,
QString line
 

No need for this function anymore - use LDIF::splitLine() + evaluatePair().

Definition at line 495 of file ldifconverter.cpp.

References evaluatePair(), QString::fromUtf8(), QString::isEmpty(), QString::latin1(), and KABC::LDIF::splitLine().

bool KABC::LDIFConverter::splitLine QString line,
QString fieldname,
QString value
 

No need for this function anymore - use LDIF::splitLine().

Definition at line 510 of file ldifconverter.cpp.

References QString::fromUtf8(), QString::latin1(), and KABC::LDIF::splitLine().

KDE Logo
This file is part of the documentation for kabc Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 12:50:15 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003