00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LDIF_P_H
00024 #define LDIF_P_H
00025
00026 #include <QtCore/QString>
00027 #include <QtCore/QByteArray>
00028
00029 #include "ldapdn_p.h"
00030
00038 class Ldif
00039 {
00040 public:
00041
00042 typedef enum {
00043 None, NewEntry, EndEntry, Item, Control, Err, MoreData
00044 } ParseValue;
00045
00046 typedef enum {
00047 Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn
00048 } EntryType;
00049
00050 typedef enum {
00051 Mod_None, Mod_Add, Mod_Replace, Mod_Del
00052 } ModType;
00053
00054 Ldif();
00055
00056 Ldif( const Ldif &that );
00057 Ldif &operator=( const Ldif &that );
00058
00059 virtual ~Ldif();
00060
00069 static QByteArray assembleLine( const QString &fieldname,
00070 const QByteArray &value, uint linelen=0,
00071 bool url=false );
00076 static QByteArray assembleLine( const QString &fieldname,
00077 const QString &value, uint linelen=0,
00078 bool url=false );
00079
00084 static bool splitLine( const QByteArray &line, QString &fieldname,
00085 QByteArray &value );
00086
00094 static bool splitControl( const QByteArray &line, QString &oid,
00095 bool &critical, QByteArray &value );
00096
00100 void startParsing();
00101
00105 ParseValue processLine();
00106
00117 ParseValue nextItem();
00118
00123 void setLdif( const QByteArray &ldif );
00124
00129 void endLdif();
00130
00134 EntryType entryType() const;
00135
00139 int modType() const;
00140
00144 LdapDN dn() const;
00145
00150 QString newRdn() const;
00151
00155 QString newSuperior() const;
00156
00160 bool delOldRdn() const;
00161
00165 QString attr() const;
00166
00170 QByteArray value() const;
00171
00175 bool isUrl() const;
00176
00180 bool isCritical() const;
00181
00185 QString oid() const;
00186
00190 uint lineNumber() const;
00191
00192 private:
00193 class LdifPrivate;
00194 LdifPrivate *const d;
00195 };
00196
00197 #endif