.TH "KABC::LDIF" kde3 "11 Jun 2005" "Version Version 3.4.1" "kabc Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KABC::LDIF \- \fBLDIF\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ldif.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBParseVal\fP { \fBNone\fP, \fBNewEntry\fP, \fBEndEntry\fP, \fBItem\fP, \fBControl\fP, \fBErr\fP, \fBMoreData\fP }"
.br
.ti -1c
.RI "enum \fBEntryType\fP { \fBEntry_None\fP, \fBEntry_Add\fP, \fBEntry_Del\fP, \fBEntry_Mod\fP, \fBEntry_Modrdn\fP }"
.br
.ti -1c
.RI "enum \fBModType\fP { \fBMod_None\fP, \fBMod_Add\fP, \fBMod_Replace\fP, \fBMod_Del\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBstartParsing\fP ()"
.br
.ti -1c
.RI "ParseVal \fBprocessLine\fP ()"
.br
.ti -1c
.RI "ParseVal \fBnextItem\fP ()"
.br
.ti -1c
.RI "void \fBsetLDIF\fP (const \fBQByteArray\fP &ldif)"
.br
.ti -1c
.RI "void \fBendLDIF\fP ()"
.br
.ti -1c
.RI "EntryType \fBentryType\fP () const "
.br
.ti -1c
.RI "int \fBmodType\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBdn\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBnewRdn\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBnewSuperior\fP () const "
.br
.ti -1c
.RI "bool \fBdelOldRdn\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBattr\fP () const "
.br
.ti -1c
.RI "const \fBQByteArray\fP & \fBval\fP () const "
.br
.ti -1c
.RI "bool \fBisUrl\fP () const "
.br
.ti -1c
.RI "bool \fBcritical\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBoid\fP () const "
.br
.ti -1c
.RI "uint \fBlineNo\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQCString\fP \fBassembleLine\fP (const \fBQString\fP &fieldname, const \fBQByteArray\fP &value, uint linelen=0, bool url=false)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBassembleLine\fP (const \fBQString\fP &fieldname, const \fBQCString\fP &value, uint linelen=0, bool url=false)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBassembleLine\fP (const \fBQString\fP &fieldname, const \fBQString\fP &value, uint linelen=0, bool url=false)"
.br
.ti -1c
.RI "static bool \fBsplitLine\fP (const \fBQCString\fP &line, \fBQString\fP &fieldname, \fBQByteArray\fP &value)"
.br
.ti -1c
.RI "static bool \fBsplitControl\fP (const \fBQCString\fP &line, \fBQString\fP &oid, bool &critical, \fBQByteArray\fP &value)"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBLDIF\fP. 

\fBLDIF\fP implements an RFC 2849 compliant \fBLDIF\fP parser. \fBLDIF\fP files are used to represent directory information on LDAP-based servers, or to describe a set of changes which are to be applied to a directory. 
.PP
Definition at line 40 of file ldif.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQCString\fP LDIF::assembleLine (const \fBQString\fP & fieldname, const \fBQByteArray\fP & value, uint linelen = \fC0\fP, bool url = \fCfalse\fP)\fC [static]\fP"
.PP
Assembles fieldname and value into a valid \fBLDIF\fP line, BASE64 encodes the value if neccessary and optionally splits into more lines. 
.PP
\fBParameters:\fP
.RS 4
\fIfieldname\fP The name of the entry. 
.br
\fIvalue\fP The value of the entry. 
.br
\fIlinelen\fP Maximum length of the lines in the result. 
.br
\fIurl\fP If true, encode value as url ( use :< ). 
.RE
.PP

.PP
Definition at line 37 of file ldif.cpp.
.PP
References KCodecs::base64Encode(), QCString::insert(), QCString::length(), and QCString::lower().
.PP
Referenced by assembleLine().
.SS "\fBQCString\fP LDIF::assembleLine (const \fBQString\fP & fieldname, const \fBQCString\fP & value, uint linelen = \fC0\fP, bool url = \fCfalse\fP)\fC [static]\fP"
.PP
This is the same as the above function, the only difference that this accepts \fBQCString\fP as the value. 
.PP
Definition at line 85 of file ldif.cpp.
.PP
References assembleLine(), and QCString::length().
.SS "\fBQCString\fP LDIF::assembleLine (const \fBQString\fP & fieldname, const \fBQString\fP & value, uint linelen = \fC0\fP, bool url = \fCfalse\fP)\fC [static]\fP"
.PP
This is the same as the above function, the only difference that this accepts \fBQString\fP as the value. 
.PP
Definition at line 100 of file ldif.cpp.
.PP
References assembleLine().
.SS "bool LDIF::splitLine (const \fBQCString\fP & line, \fBQString\fP & fieldname, \fBQByteArray\fP & value)\fC [static]\fP"
.PP
Splits one line from an \fBLDIF\fP file to attribute and value components. 
.PP
\fBReturns:\fP
.RS 4
true if value is an URL, false otherwise 
.RE
.PP

.PP
Definition at line 106 of file ldif.cpp.
.PP
References KCodecs::base64Decode(), QCString::find(), QString::fromUtf8(), QCString::left(), QCString::length(), QCString::resize(), and QCString::stripWhiteSpace().
.PP
Referenced by processLine(), and splitControl().
.SS "bool LDIF::splitControl (const \fBQCString\fP & line, \fBQString\fP & oid, bool & critical, \fBQByteArray\fP & value)\fC [static]\fP"
.PP
Splits a control specification (without the 'control:' directive). 
.PP
\fBParameters:\fP
.RS 4
\fIline\fP is the control directive 
.br
\fIoid\fP will contain the OID 
.br
\fIcritical\fP will contain the criticality of control 
.br
\fIvalue\fP is the control value 
.RE
.PP

.PP
Definition at line 174 of file ldif.cpp.
.PP
References critical(), endl(), QString::fromUtf8(), QString::isEmpty(), kdDebug(), QString::length(), oid(), QString::right(), splitLine(), and QString::truncate().
.PP
Referenced by processLine().
.SS "void LDIF::startParsing ()"
.PP
Starts the parsing of a new \fBLDIF\fP. 
.PP
Definition at line 354 of file ldif.cpp.
.SS "LDIF::ParseVal LDIF::processLine ()"
.PP
Process one \fBLDIF\fP line. 
.PP
Definition at line 197 of file ldif.cpp.
.PP
References endl(), QString::fromUtf8(), QString::isEmpty(), kdDebug(), QString::lower(), splitControl(), and splitLine().
.PP
Referenced by nextItem().
.SS "LDIF::ParseVal LDIF::nextItem ()"
.PP
Process the \fBLDIF\fP until a complete item can be returned. 
.PP
\fBReturns:\fP
.RS 4
NewEntry if a new DN encountered, Item if a new item returned, Err if the \fBLDIF\fP contains error, EndEntry if the parser reached the end of the current entry and MoreData if the parser encountered the end of the current chunk of the \fBLDIF\fP. If you want to finish the parsing after receiving MoreData, then call \fBendLDIF()\fP, so the parser can safely flush the current entry. 
.RE
.PP

.PP
Definition at line 308 of file ldif.cpp.
.PP
References processLine(), and QCString::resize().
.SS "void KABC::LDIF::setLDIF (const \fBQByteArray\fP & ldif)\fC [inline]\fP"
.PP
Sets a chunk of \fBLDIF\fP. 
.PP
Call before \fBstartParsing()\fP, or if \fBnextItem()\fP returned MoreData. 
.PP
Definition at line 111 of file ldif.h.
.SS "void LDIF::endLDIF ()"
.PP
Indicates the end of the \fBLDIF\fP file/stream. 
.PP
Call if \fBnextItem()\fP returned MoreData, but actually you don't have more data. 
.PP
Definition at line 344 of file ldif.cpp.
.SS "EntryType KABC::LDIF::entryType () const\fC [inline]\fP"
.PP
Returns the requested LDAP operation extracted from the current entry. 
.PP
Definition at line 120 of file ldif.h.
.SS "int KABC::LDIF::modType () const\fC [inline]\fP"
.PP
Returns the LDAP modify request type if \fBentryType()\fP returned Entry_Mod. 
.PP
Definition at line 124 of file ldif.h.
.SS "const \fBQString\fP& KABC::LDIF::dn () const\fC [inline]\fP"
.PP
Returns the Distinguished Name of the current entry. 
.PP
Definition at line 128 of file ldif.h.
.SS "const \fBQString\fP& KABC::LDIF::newRdn () const\fC [inline]\fP"
.PP
Returns the new Relative Distinguished Name if \fBmodType()\fP returned Entry_Modrdn. 
.PP
Definition at line 132 of file ldif.h.
.SS "const \fBQString\fP& KABC::LDIF::newSuperior () const\fC [inline]\fP"
.PP
Returns the new parent of the entry if \fBmodType()\fP returned Entry_Modrdn. 
.PP
Definition at line 136 of file ldif.h.
.SS "bool KABC::LDIF::delOldRdn () const\fC [inline]\fP"
.PP
Returns if the delete of the old RDN is required. 
.PP
Definition at line 140 of file ldif.h.
.SS "const \fBQString\fP& KABC::LDIF::attr () const\fC [inline]\fP"
.PP
Returns the attribute name. 
.PP
Definition at line 144 of file ldif.h.
.SS "const \fBQByteArray\fP& KABC::LDIF::val () const\fC [inline]\fP"
.PP
Returns the attribute value. 
.PP
Definition at line 148 of file ldif.h.
.SS "bool KABC::LDIF::isUrl () const\fC [inline]\fP"
.PP
Returns if \fBval()\fP is an url. 
.PP
Definition at line 152 of file ldif.h.
.SS "bool KABC::LDIF::critical () const\fC [inline]\fP"
.PP
Returns the criticality level when \fBmodType()\fP returned Control. 
.PP
Definition at line 156 of file ldif.h.
.PP
Referenced by splitControl().
.SS "const \fBQString\fP& KABC::LDIF::oid () const\fC [inline]\fP"
.PP
Returns the OID when \fBmodType()\fP returned Control. 
.PP
Definition at line 160 of file ldif.h.
.PP
Referenced by splitControl().
.SS "uint KABC::LDIF::lineNo () const\fC [inline]\fP"
.PP
Returns the line number which the parser processes. 
.PP
Definition at line 164 of file ldif.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kabc Library from the source code.
