• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KLDAP Library

  • kldap
ldif.h
1/*
2 This file is part of libkldap.
3 Copyright (c) 2004-2006 Szombathelyi György <gyurco@freemail.hu>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KLDAP_LDIF_H
22#define KLDAP_LDIF_H
23
24#include <QtCore/QString>
25#include <QtCore/QByteArray>
26
27#include "ldapdn.h"
28#include "kldap_export.h"
29
30namespace KLDAP {
31
39
40class KLDAP_EXPORT Ldif
41{
42 public:
43
44 typedef enum {
45 None, NewEntry, EndEntry, Item, Control, Err, MoreData
46 } ParseValue;
47
48 typedef enum {
49 Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn
50 } EntryType;
51
52 typedef enum {
53 Mod_None, Mod_Add, Mod_Replace, Mod_Del
54 } ModType;
55
56 Ldif();
57
58 Ldif( const Ldif &that );
59 Ldif &operator=( const Ldif &that );
60
61 virtual ~Ldif();
62
71 static QByteArray assembleLine( const QString &fieldname,
72 const QByteArray &value, uint linelen=0,
73 bool url=false );
78 static QByteArray assembleLine( const QString &fieldname,
79 const QString &value, uint linelen=0,
80 bool url=false );
81
86 static bool splitLine( const QByteArray &line, QString &fieldname,
87 QByteArray &value );
88
96 static bool splitControl( const QByteArray &line, QString &oid,
97 bool &critical, QByteArray &value );
98
102 void startParsing();
103
107 ParseValue processLine();
108
119 ParseValue nextItem();
120
126 void setLdif( const QByteArray &ldif );
127
132 void endLdif();
133
137 EntryType entryType() const;
138
142 int modType() const;
143
147 LdapDN dn() const;
148
153 QString newRdn() const;
154
158 QString newSuperior() const;
159
163 bool delOldRdn() const;
164
168 QString attr() const;
169
173 QByteArray value() const;
174
178 bool isUrl() const;
179
183 bool isCritical() const;
184
188 QString oid() const;
189
193 uint lineNumber() const;
194
195 private:
196 class LdifPrivate;
197 LdifPrivate *const d;
198};
199
200}
201
202#endif
KLDAP::Ldif::modType
int modType() const
Returns the LDAP modify request type if entryType() returned Entry_Mod.
Definition ldif.cpp:398
KLDAP::Ldif::processLine
ParseValue processLine()
Process one Ldif line.
Definition ldif.cpp:198
KLDAP::Ldif::assembleLine
static QByteArray assembleLine(const QString &fieldname, const QByteArray &value, uint linelen=0, bool url=false)
Assembles fieldname and value into a valid Ldif line, BASE64 encodes the value if necessary and optio...
Definition ldif.cpp:71
KLDAP::Ldif::endLdif
void endLdif()
Indicates the end of the Ldif file/stream.
Definition ldif.cpp:365
KLDAP::Ldif::lineNumber
uint lineNumber() const
Returns the line number which the parser processes.
Definition ldif.cpp:448
KLDAP::Ldif::value
QByteArray value() const
Returns the attribute value.
Definition ldif.cpp:428
KLDAP::Ldif::nextItem
ParseValue nextItem()
Process the Ldif until a complete item can be returned.
Definition ldif.cpp:325
KLDAP::Ldif::delOldRdn
bool delOldRdn() const
Returns if the delete of the old RDN is required.
Definition ldif.cpp:418
KLDAP::Ldif::isUrl
bool isUrl() const
Returns if val() is an url.
Definition ldif.cpp:433
KLDAP::Ldif::oid
QString oid() const
Returns the OID when modType() returned Control.
Definition ldif.cpp:443
KLDAP::Ldif::attr
QString attr() const
Returns the attribute name.
Definition ldif.cpp:423
KLDAP::Ldif::splitControl
static bool splitControl(const QByteArray &line, QString &oid, bool &critical, QByteArray &value)
Splits a control specification (without the "control:" directive)
Definition ldif.cpp:175
KLDAP::Ldif::startParsing
void startParsing()
Starts the parsing of a new Ldif.
Definition ldif.cpp:372
KLDAP::Ldif::setLdif
void setLdif(const QByteArray &ldif)
Sets a chunk of Ldif.
Definition ldif.cpp:387
KLDAP::Ldif::dn
LdapDN dn() const
Returns the Distinguished Name of the current entry.
Definition ldif.cpp:403
KLDAP::Ldif::isCritical
bool isCritical() const
Returns the criticality level when modType() returned Control.
Definition ldif.cpp:438
KLDAP::Ldif::splitLine
static bool splitLine(const QByteArray &line, QString &fieldname, QByteArray &value)
Splits one line from an Ldif file to attribute and value components.
Definition ldif.cpp:127
KLDAP::Ldif::newRdn
QString newRdn() const
Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn.
Definition ldif.cpp:408
KLDAP::Ldif::entryType
EntryType entryType() const
Returns the requested LDAP operation extracted from the current entry.
Definition ldif.cpp:393
KLDAP::Ldif::newSuperior
QString newSuperior() const
Returns the new parent of the entry if modType() returned Entry_Modrdn.
Definition ldif.cpp:413
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KLDAP Library

Skip menu "KLDAP Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal