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

kabc

  • kabc
ldif_p.h
1/*
2 A temporary copy to break dependency to KLDAP
3
4 This file is part of libkldap.
5 Copyright (c) 2004-2006 Szombathelyi György <gyurco@freemail.hu>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef LDIF_P_H
24#define LDIF_P_H
25
26#include <QtCore/QString>
27#include <QtCore/QByteArray>
28
29#include "ldapdn_p.h"
30
38class Ldif
39{
40 public:
41
42 typedef enum {
43 None, NewEntry, EndEntry, Item, Control, Err, MoreData
44 } ParseValue;
45
46 typedef enum {
47 Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn
48 } EntryType;
49
50 typedef enum {
51 Mod_None, Mod_Add, Mod_Replace, Mod_Del
52 } ModType;
53
54 Ldif();
55
56 Ldif( const Ldif &that );
57 Ldif &operator=( const Ldif &that );
58
59 virtual ~Ldif();
60
69 static QByteArray assembleLine( const QString &fieldname,
70 const QByteArray &value, uint linelen=0,
71 bool url=false );
76 static QByteArray assembleLine( const QString &fieldname,
77 const QString &value, uint linelen=0,
78 bool url=false );
79
84 static bool splitLine( const QByteArray &line, QString &fieldname,
85 QByteArray &value );
86
94 static bool splitControl( const QByteArray &line, QString &oid,
95 bool &critical, QByteArray &value );
96
100 void startParsing();
101
105 ParseValue processLine();
106
117 ParseValue nextItem();
118
123 void setLdif( const QByteArray &ldif );
124
129 void endLdif();
130
134 EntryType entryType() const;
135
139 int modType() const;
140
144 LdapDN dn() const;
145
150 QString newRdn() const;
151
155 QString newSuperior() const;
156
160 bool delOldRdn() const;
161
165 QString attr() const;
166
170 QByteArray value() const;
171
175 bool isUrl() const;
176
180 bool isCritical() const;
181
185 QString oid() const;
186
190 uint lineNumber() const;
191
192 private:
193 class LdifPrivate;
194 LdifPrivate *const d;
195};
196
197#endif
Ldif
Ldif.
Definition: ldif_p.h:39
Ldif::modType
int modType() const
Returns the LDAP modify request type if entryType() returned Entry_Mod.
Definition: ldif.cpp:400
Ldif::processLine
ParseValue processLine()
Process one Ldif line.
Definition: ldif.cpp:200
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
Ldif::endLdif
void endLdif()
Indicates the end of the Ldif file/stream.
Definition: ldif.cpp:367
Ldif::lineNumber
uint lineNumber() const
Returns the line number which the parser processes.
Definition: ldif.cpp:450
Ldif::value
QByteArray value() const
Returns the attribute value.
Definition: ldif.cpp:430
Ldif::nextItem
ParseValue nextItem()
Process the Ldif until a complete item can be returned.
Definition: ldif.cpp:327
Ldif::delOldRdn
bool delOldRdn() const
Returns if the delete of the old RDN is required.
Definition: ldif.cpp:420
Ldif::isUrl
bool isUrl() const
Returns if val() is an url.
Definition: ldif.cpp:435
Ldif::oid
QString oid() const
Returns the OID when modType() returned Control.
Definition: ldif.cpp:445
Ldif::attr
QString attr() const
Returns the attribute name.
Definition: ldif.cpp:425
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:177
Ldif::startParsing
void startParsing()
Starts the parsing of a new Ldif.
Definition: ldif.cpp:374
Ldif::setLdif
void setLdif(const QByteArray &ldif)
Sets a chunk of Ldif.
Definition: ldif.cpp:389
Ldif::dn
LdapDN dn() const
Returns the Distinguished Name of the current entry.
Definition: ldif.cpp:405
Ldif::isCritical
bool isCritical() const
Returns the criticality level when modType() returned Control.
Definition: ldif.cpp:440
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:129
Ldif::newRdn
QString newRdn() const
Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn.
Definition: ldif.cpp:410
Ldif::entryType
EntryType entryType() const
Returns the requested LDAP operation extracted from the current entry.
Definition: ldif.cpp:395
Ldif::newSuperior
QString newSuperior() const
Returns the new parent of the entry if modType() returned Entry_Modrdn.
Definition: ldif.cpp:415
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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