KLDAP Library
KLDAP::Ldif Class Reference
#include <ldif.h>
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.
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) |
Member Function Documentation
QByteArray Ldif::assembleLine | ( | const QString & | fieldname, | |
const QString & | value, | |||
uint | linelen = 0 , |
|||
bool | url = false | |||
) | [static] |
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 :< ).
bool Ldif::delOldRdn | ( | ) | const |
LdapDN Ldif::dn | ( | ) | const |
void Ldif::endLdif | ( | ) |
Indicates the end of the Ldif file/stream.
Call if nextItem() returned MoreData, but actually you don't have more data.
Ldif::EntryType Ldif::entryType | ( | ) | const |
bool Ldif::isCritical | ( | ) | const |
uint Ldif::lineNumber | ( | ) | const |
int Ldif::modType | ( | ) | const |
Returns the LDAP modify request type if entryType() returned Entry_Mod.
QString Ldif::newRdn | ( | ) | const |
QString Ldif::newSuperior | ( | ) | const |
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.
QString Ldif::oid | ( | ) | const |
Ldif::ParseValue Ldif::processLine | ( | ) |
void Ldif::setLdif | ( | const QByteArray & | ldif | ) |
Sets a chunk of Ldif.
Call before startParsing(), or if nextItem() returned MoreData.
bool Ldif::splitControl | ( | const QByteArray & | line, | |
QString & | oid, | |||
bool & | critical, | |||
QByteArray & | value | |||
) | [static] |
bool Ldif::splitLine | ( | const QByteArray & | line, | |
QString & | fieldname, | |||
QByteArray & | value | |||
) | [static] |
void Ldif::startParsing | ( | ) |
QByteArray Ldif::value | ( | ) | const |
The documentation for this class was generated from the following files: