KLDAP::Ldif Class Reference
Ldif.
More...
#include <ldif.h>
List of all members.
Public Types |
enum | EntryType {
Entry_None,
Entry_Add,
Entry_Del,
Entry_Mod,
Entry_Modrdn
} |
enum | ModType { Mod_None,
Mod_Add,
Mod_Replace,
Mod_Del
} |
enum | ParseValue {
None,
NewEntry,
EndEntry,
Item,
Control,
Err,
MoreData
} |
Public Member Functions |
QString | attr () const |
bool | delOldRdn () const |
LdapDN | dn () const |
void | endLdif () |
EntryType | entryType () const |
bool | isCritical () const |
bool | isUrl () const |
| Ldif (const Ldif &that) |
uint | lineNumber () const |
int | modType () const |
QString | newRdn () const |
QString | newSuperior () const |
ParseValue | nextItem () |
QString | oid () const |
Ldif & | operator= (const Ldif &that) |
ParseValue | processLine () |
void | setLdif (const QByteArray &ldif) |
void | startParsing () |
QByteArray | value () const |
Static Public Member Functions |
static QByteArray | assembleLine (const QString &fieldname, const QString &value, uint linelen=0, bool url=false) |
static QByteArray | assembleLine (const QString &fieldname, const QByteArray &value, uint linelen=0, bool url=false) |
static bool | splitControl (const QByteArray &line, QString &oid, bool &critical, QByteArray &value) |
static bool | splitLine (const QByteArray &line, QString &fieldname, QByteArray &value) |
Detailed Description
Ldif.
Ldif implements an RFC 2849 compliant Ldif parser. Ldif 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.
Definition at line 40 of file ldif.h.
Member Function Documentation
QByteArray Ldif::assembleLine |
( |
const QString & |
fieldname, |
|
|
const QString & |
value, |
|
|
uint |
linelen = 0 , |
|
|
bool |
url = false | |
|
) |
| | [static] |
This is the same as the above function, the only difference that this accepts QString as the value.
Definition at line 121 of file ldif.cpp.
QByteArray Ldif::assembleLine |
( |
const QString & |
fieldname, |
|
|
const QByteArray & |
value, |
|
|
uint |
linelen = 0 , |
|
|
bool |
url = false | |
|
) |
| | [static] |
Assembles fieldname and value into a valid Ldif line, BASE64 encodes the value if necessary and optionally splits into more lines.
- Parameters:
-
| fieldname | The name of the entry. |
| value | The value of the entry. |
| linelen | Maximum length of the lines in the result. |
| url | If true, encode value as url ( use :< ). |
Definition at line 71 of file ldif.cpp.
QString Ldif::attr |
( |
|
) |
const |
Returns the attribute name.
Definition at line 423 of file ldif.cpp.
bool Ldif::delOldRdn |
( |
|
) |
const |
Returns if the delete of the old RDN is required.
Definition at line 418 of file ldif.cpp.
LdapDN Ldif::dn |
( |
|
) |
const |
Returns the Distinguished Name of the current entry.
Definition at line 403 of file ldif.cpp.
Indicates the end of the Ldif file/stream.
Call if nextItem() returned MoreData, but actually you don't have more data.
Definition at line 365 of file ldif.cpp.
Ldif::EntryType Ldif::entryType |
( |
|
) |
const |
Returns the requested LDAP operation extracted from the current entry.
Definition at line 393 of file ldif.cpp.
bool Ldif::isCritical |
( |
|
) |
const |
Returns the criticality level when modType() returned Control.
Definition at line 438 of file ldif.cpp.
bool Ldif::isUrl |
( |
|
) |
const |
Returns if val() is an url.
Definition at line 433 of file ldif.cpp.
uint Ldif::lineNumber |
( |
|
) |
const |
Returns the line number which the parser processes.
Definition at line 448 of file ldif.cpp.
int Ldif::modType |
( |
|
) |
const |
Returns the LDAP modify request type if entryType() returned Entry_Mod.
Definition at line 398 of file ldif.cpp.
QString Ldif::newRdn |
( |
|
) |
const |
Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn.
Definition at line 408 of file ldif.cpp.
QString Ldif::newSuperior |
( |
|
) |
const |
Returns the new parent of the entry if modType() returned Entry_Modrdn.
Definition at line 413 of file ldif.cpp.
Ldif::ParseValue Ldif::nextItem |
( |
|
) |
|
Process the Ldif until a complete item can be returned.
- Returns:
- NewEntry if a new DN encountered, Item if a new item returned, Err if the Ldif 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 Ldif.
If you want to finish the parsing after receiving MoreData, then call endLdif(), so the parser can safely flush the current entry.
Definition at line 325 of file ldif.cpp.
QString Ldif::oid |
( |
|
) |
const |
Ldif::ParseValue Ldif::processLine |
( |
|
) |
|
void Ldif::setLdif |
( |
const QByteArray & |
ldif |
) |
|
bool Ldif::splitControl |
( |
const QByteArray & |
line, |
|
|
QString & |
oid, |
|
|
bool & |
critical, |
|
|
QByteArray & |
value | |
|
) |
| | [static] |
Splits a control specification (without the "control:" directive).
- Parameters:
-
| line | is the control directive |
| oid | will contain the OID |
| critical | will contain the criticality of control |
| value | is the control value |
Definition at line 175 of file ldif.cpp.
bool Ldif::splitLine |
( |
const QByteArray & |
line, |
|
|
QString & |
fieldname, |
|
|
QByteArray & |
value | |
|
) |
| | [static] |
Splits one line from an Ldif file to attribute and value components.
- Returns:
- true if value is an URL, false otherwise
Definition at line 127 of file ldif.cpp.
void Ldif::startParsing |
( |
|
) |
|
QByteArray Ldif::value |
( |
|
) |
const |
Returns the attribute value.
Definition at line 428 of file ldif.cpp.
The documentation for this class was generated from the following files: