libkdepim Library API Documentation

KPIM::LDIF Class Reference

LDIF. More...

#include <ldif.h>

Collaboration diagram for KPIM::LDIF:

Collaboration graph
[legend]
List of all members.

Public Types

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

void startParsing ()
ParseVal processLine ()
ParseVal nextItem ()
void setLDIF (const QByteArray &ldif)
void endLDIF ()
EntryType entryType () const
int modType () const
const QStringdn () const
const QStringnewRdn () const
const QStringnewSuperior () const
bool delOldRdn () const
const QStringattr () const
const QByteArrayval () const
bool isUrl () const
bool critical () const
const QStringoid () 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)

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 38 of file ldif.h.


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 :< ).

Definition at line 37 of file ldif.cpp.

Referenced by assembleLine().

QCString LDIF::assembleLine const QString fieldname,
const QCString value,
uint  linelen = 0,
bool  url = false
[static]
 

This is the same as the above function, the only difference that this accepts QCString as the value.

Definition at line 85 of file ldif.cpp.

References assembleLine().

QCString 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 98 of file ldif.cpp.

References assembleLine().

bool LDIF::splitLine const QCString 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 104 of file ldif.cpp.

Referenced by processLine(), and splitControl().

bool LDIF::splitControl const QCString line,
QString oid,
bool &  critical,
QByteArray value
[static]
 

Splits a control specification (without the "control:" directive).

Parameters:
line is the control directive will contain the OID will contain the criticality of control is the control value

Definition at line 167 of file ldif.cpp.

References splitLine().

Referenced by processLine().

void LDIF::startParsing  ) 
 

Starts the parsing of a new LDIF.

Definition at line 345 of file ldif.cpp.

LDIF::ParseVal LDIF::processLine  ) 
 

Process one LDIF line.

Definition at line 190 of file ldif.cpp.

References splitControl(), and splitLine().

Referenced by nextItem().

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.

Definition at line 300 of file ldif.cpp.

References processLine().

void KPIM::LDIF::setLDIF const QByteArray ldif  )  [inline]
 

Sets a chunk of LDIF.

Call before startParsing(), or if nextItem() returned MoreData.

Definition at line 109 of file ldif.h.

void LDIF::endLDIF  ) 
 

Indicates the end of the LDIF file/stream.

Call if nextItem() returned MoreData, but actually you don't have more data.

Definition at line 336 of file ldif.cpp.

EntryType KPIM::LDIF::entryType  )  const [inline]
 

Returns the requested LDAP operation extracted from the current entry.

Definition at line 118 of file ldif.h.

int KPIM::LDIF::modType  )  const [inline]
 

Returns the LDAP modify request type if entryType() returned Entry_Mod.

Definition at line 122 of file ldif.h.

const QString& KPIM::LDIF::dn  )  const [inline]
 

Returns the Distinguished Name of the current entry.

Definition at line 126 of file ldif.h.

const QString& KPIM::LDIF::newRdn  )  const [inline]
 

Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn.

Definition at line 130 of file ldif.h.

const QString& KPIM::LDIF::newSuperior  )  const [inline]
 

Returns the new parent of the entry if modType() returned Entry_Modrdn.

Definition at line 134 of file ldif.h.

bool KPIM::LDIF::delOldRdn  )  const [inline]
 

Returns if the delete of the old RDN is required.

Definition at line 138 of file ldif.h.

const QString& KPIM::LDIF::attr  )  const [inline]
 

Returns the attribute name.

Definition at line 142 of file ldif.h.

const QByteArray& KPIM::LDIF::val  )  const [inline]
 

Returns the attribute value.

Definition at line 146 of file ldif.h.

bool KPIM::LDIF::isUrl  )  const [inline]
 

Returns if val() is an url.

Definition at line 150 of file ldif.h.

bool KPIM::LDIF::critical  )  const [inline]
 

Returns the criticality level when modType() returned Control.

Definition at line 154 of file ldif.h.

const QString& KPIM::LDIF::oid  )  const [inline]
 

Returns the OID when modType() returned Control.

Definition at line 158 of file ldif.h.

uint KPIM::LDIF::lineNo  )  const [inline]
 

Returns the line number which the parser processes.

Definition at line 162 of file ldif.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:53:33 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003