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
#include <kdelibs_export.h>
00029
00030
namespace KABC {
00031
00040 class KABC_EXPORT LDIF
00041 {
00042
public:
00043
00044
typedef enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData };
00045
typedef enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn };
00046
typedef enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del };
00047 LDIF();
00048
virtual ~LDIF();
00049
00058
static QCString assembleLine(
const QString &fieldname,
00059
const QByteArray &value, uint linelen=0,
bool url=
false );
00064
static QCString assembleLine(
const QString &fieldname,
00065
const QCString &value, uint linelen=0,
bool url=
false );
00070
static QCString assembleLine(
const QString &fieldname,
00071
const QString &value, uint linelen=0,
bool url=
false );
00072
00077
static bool splitLine(
const QCString &line,
QString &fieldname,
QByteArray &value );
00085
static bool splitControl(
const QCString &line,
QString &oid,
bool &critical,
00086
QByteArray &value );
00090
void startParsing();
00094 ParseVal processLine();
00106 ParseVal nextItem();
00111 void setLDIF(
const QByteArray &ldif ) { mLdif = ldif; mPos = 0; };
00116
void endLDIF();
00120 EntryType entryType()
const {
return mEntryType; }
00124 int modType()
const {
return mModType; }
00128 const QString& dn()
const {
return mDn; }
00132 const QString& newRdn()
const {
return mNewRdn; }
00136 const QString& newSuperior()
const {
return mNewSuperior; }
00140 bool delOldRdn()
const {
return mDelOldRdn; }
00144 const QString& attr()
const {
return mAttr; }
00148 const QByteArray& val()
const {
return mVal; }
00152 bool isUrl()
const {
return mUrl; }
00156 bool critical()
const {
return mCritical; }
00160 const QString& oid()
const {
return mOid; }
00164 uint lineNo()
const {
return mLineNo; }
00165
private:
00166
int mModType;
00167
bool mDelOldRdn, mUrl;
00168
QString mDn,mAttr,mNewRdn,mNewSuperior, mOid;
00169
QByteArray mLdif, mVal;
00170 EntryType mEntryType;
00171
00172
bool mIsNewLine, mIsComment,mCritical;
00173 ParseVal mLastParseVal;
00174 uint mPos,mLineNo;
00175
QCString line;
00176
00177
class LDIFPrivate;
00178 LDIFPrivate *d;
00179 };
00180 }
00181
00182
#endif
This file is part of the documentation for kabc Library Version 3.4.0.