KABC::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 | |
None | |
NewEntry | |
EndEntry | |
Item | |
Control | |
Err | |
MoreData | |
Entry_None | |
Entry_Add | |
Entry_Del | |
Entry_Mod | |
Entry_Modrdn | |
Mod_None | |
Mod_Add | |
Mod_Replace | |
Mod_Del | |
enum | ParseVal { None, NewEntry, EndEntry, Item, Control, Err, MoreData } |
enum | EntryType { Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn } |
enum | ModType { Mod_None, Mod_Add, Mod_Replace, Mod_Del } |
Public Member Functions | |
LDIF () | |
virtual | ~LDIF () |
void | startParsing () |
ParseVal | processLine () |
ParseVal | nextItem () |
void | setLDIF (const QByteArray &ldif) |
void | endLDIF () |
EntryType | entryType () const |
int | modType () const |
const QString & | dn () const |
const QString & | newRdn () const |
const QString & | newSuperior () const |
bool | delOldRdn () const |
const QString & | attr () const |
const QByteArray & | val () const |
bool | isUrl () const |
bool | critical () const |
const QString & | oid () const |
uint | lineNo () const |
Static Public Member Functions | |
static QCString | assembleLine (const QString &fieldname, const QByteArray &value, uint linelen=0, bool url=false) |
static QCString | assembleLine (const QString &fieldname, const QCString &value, uint linelen=0, bool url=false) |
static QCString | assembleLine (const QString &fieldname, const QString &value, uint linelen=0, bool url=false) |
static bool | splitLine (const QCString &line, QString &fieldname, QByteArray &value) |
static bool | splitControl (const QCString &line, QString &oid, bool &critical, QByteArray &value) |
Member Function Documentation
QCString 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 neccessary 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 :< ).
const QString& KABC::LDIF::attr | ( | ) | const [inline] |
bool KABC::LDIF::critical | ( | ) | const [inline] |
bool KABC::LDIF::delOldRdn | ( | ) | const [inline] |
const QString& KABC::LDIF::dn | ( | ) | const [inline] |
void LDIF::endLDIF | ( | ) |
Indicates the end of the LDIF file/stream.
Call if nextItem() returned MoreData, but actually you don't have more data.
EntryType KABC::LDIF::entryType | ( | ) | const [inline] |
bool KABC::LDIF::isUrl | ( | ) | const [inline] |
uint KABC::LDIF::lineNo | ( | ) | const [inline] |
int KABC::LDIF::modType | ( | ) | const [inline] |
Returns the LDAP modify request type if entryType() returned Entry_Mod.
const QString& KABC::LDIF::newRdn | ( | ) | const [inline] |
const QString& KABC::LDIF::newSuperior | ( | ) | const [inline] |
LDIF::ParseVal 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.
const QString& KABC::LDIF::oid | ( | ) | const [inline] |
LDIF::ParseVal LDIF::processLine | ( | ) |
void KABC::LDIF::setLDIF | ( | const QByteArray & | ldif | ) | [inline] |
Sets a chunk of LDIF.
Call before startParsing(), or if nextItem() returned MoreData.
bool LDIF::splitControl | ( | const QCString & | line, | |
QString & | oid, | |||
bool & | critical, | |||
QByteArray & | value | |||
) | [static] |
bool LDIF::splitLine | ( | const QCString & | line, | |
QString & | fieldname, | |||
QByteArray & | value | |||
) | [static] |
void LDIF::startParsing | ( | ) |
const QByteArray& KABC::LDIF::val | ( | ) | const [inline] |
The documentation for this class was generated from the following files: