ldif.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef _K_LDIF_H_
00022
#define _K_LDIF_H_
00023
00024
#include <qstring.h>
00025
#include <qcstring.h>
00026
#include <qmemarray.h>
00027
00028
namespace KABC {
00029
00038 class LDIF
00039 {
00040
public:
00041
00042
typedef enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData };
00043
typedef enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn };
00044
typedef enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del };
00045
LDIF();
00046
virtual ~
LDIF();
00047
00056
static QCString assembleLine(
const QString &fieldname,
00057
const QByteArray &value, uint linelen=0,
bool url=
false );
00062
static QCString assembleLine(
const QString &fieldname,
00063
const QCString &value, uint linelen=0,
bool url=
false );
00068
static QCString assembleLine(
const QString &fieldname,
00069
const QString &value, uint linelen=0,
bool url=
false );
00070
00075
static bool splitLine(
const QCString &line,
QString &fieldname,
QByteArray &value );
00083
static bool splitControl(
const QCString &line,
QString &
oid,
bool &
critical,
00084
QByteArray &value );
00088
void startParsing();
00092 ParseVal
processLine();
00104 ParseVal
nextItem();
00109 void setLDIF(
const QByteArray &ldif ) { mLdif = ldif; mPos = 0; };
00114
void endLDIF();
00118 EntryType
entryType()
const {
return mEntryType; }
00122 int modType()
const {
return mModType; }
00126 const QString&
dn()
const {
return mDn; }
00130 const QString&
newRdn()
const {
return mNewRdn; }
00134 const QString&
newSuperior()
const {
return mNewSuperior; }
00138 bool delOldRdn()
const {
return mDelOldRdn; }
00142 const QString&
attr()
const {
return mAttr; }
00146 const QByteArray&
val()
const {
return mVal; }
00150 bool isUrl()
const {
return mUrl; }
00154 bool critical()
const {
return mCritical; }
00158 const QString&
oid()
const {
return mOid; }
00162 uint
lineNo()
const {
return mLineNo; }
00163
private:
00164
int mModType;
00165
bool mDelOldRdn, mUrl;
00166
QString mDn,mAttr,mNewRdn,mNewSuperior, mOid;
00167
QByteArray mLdif, mVal;
00168 EntryType mEntryType;
00169
00170
bool mIsNewLine, mIsComment,mCritical;
00171 ParseVal mLastParseVal;
00172 uint mPos,mLineNo;
00173
QCString line;
00174
00175
class LDIFPrivate;
00176 LDIFPrivate *d;
00177 };
00178 }
00179
00180
#endif
This file is part of the documentation for kabc Library Version 3.3.0.