• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kabc
 

kabc

  • kabc
ldif.h
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2004 Szombathelyi Gyorgy <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 _K_LDIF_H_
22 #define _K_LDIF_H_
23 
24 #include <tqstring.h>
25 #include <tqcstring.h>
26 #include <tqmemarray.h>
27 
28 #include <kdelibs_export.h>
29 
30 namespace KABC {
31 
40  class KABC_EXPORT LDIF
41  {
42  public:
43 
44  enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData };
45  enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn };
46  enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del };
47  LDIF();
48  virtual ~LDIF();
49 
58  static TQCString assembleLine( const TQString &fieldname,
59  const TQByteArray &value, uint linelen=0, bool url=false );
64  static TQCString assembleLine( const TQString &fieldname,
65  const TQCString &value, uint linelen=0, bool url=false );
70  static TQCString assembleLine( const TQString &fieldname,
71  const TQString &value, uint linelen=0, bool url=false );
72 
77  static bool splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value );
85  static bool splitControl( const TQCString &line, TQString &oid, bool &critical,
86  TQByteArray &value );
90  void startParsing();
94  ParseVal processLine();
106  ParseVal nextItem();
111  void setLDIF( const TQByteArray &ldif ) { mLdif = ldif; mPos = 0; }
116  void endLDIF();
120  EntryType entryType() const { return mEntryType; }
124  int modType() const { return mModType; }
128  const TQString& dn() const { return mDn; }
132  const TQString& newRdn() const { return mNewRdn; }
136  const TQString& newSuperior() const { return mNewSuperior; }
140  bool delOldRdn() const { return mDelOldRdn; }
144  const TQString& attr() const { return mAttr; }
148  const TQByteArray& val() const { return mVal; }
152  bool isUrl() const { return mUrl; }
156  bool critical() const { return mCritical; }
160  const TQString& oid() const { return mOid; }
164  uint lineNo() const { return mLineNo; }
165  private:
166  int mModType;
167  bool mDelOldRdn, mUrl;
168  TQString mDn,mAttr,mNewRdn,mNewSuperior, mOid;
169  TQByteArray mLdif, mVal;
170  EntryType mEntryType;
171 
172  bool mIsNewLine, mIsComment,mCritical;
173  ParseVal mLastParseVal;
174  uint mPos,mLineNo;
175  TQCString line;
176 
177  class LDIFPrivate;
178  LDIFPrivate *d;
179  };
180 }
181 
182 #endif
KABC::LDIF::val
const TQByteArray & val() const
Returns the attribute value.
Definition: ldif.h:148
KABC::LDIF::delOldRdn
bool delOldRdn() const
Returns if the delete of the old RDN is required.
Definition: ldif.h:140
KABC::LDIF::critical
bool critical() const
Returns the criticality level when modType() returned Control.
Definition: ldif.h:156
KABC::LDIF::attr
const TQString & attr() const
Returns the attribute name.
Definition: ldif.h:144
KABC::LDIF::isUrl
bool isUrl() const
Returns if val() is an url.
Definition: ldif.h:152
KABC::LDIF::setLDIF
void setLDIF(const TQByteArray &ldif)
Sets a chunk of LDIF.
Definition: ldif.h:111
KABC::LDIF::entryType
EntryType entryType() const
Returns the requested LDAP operation extracted from the current entry.
Definition: ldif.h:120
KABC::LDIF
LDIF.
Definition: ldif.h:40
KABC::LDIF::lineNo
uint lineNo() const
Returns the line number which the parser processes.
Definition: ldif.h:164
KABC::LDIF::newSuperior
const TQString & newSuperior() const
Returns the new parent of the entry if modType() returned Entry_Modrdn.
Definition: ldif.h:136
KABC::LDIF::oid
const TQString & oid() const
Returns the OID when modType() returned Control.
Definition: ldif.h:160
KABC::LDIF::modType
int modType() const
Returns the LDAP modify request type if entryType() returned Entry_Mod.
Definition: ldif.h:124
KABC::LDIF::dn
const TQString & dn() const
Returns the Distinguished Name of the current entry.
Definition: ldif.h:128
KABC
static data, shared by ALL addressee objects
Definition: address.h:48
KABC::LDIF::newRdn
const TQString & newRdn() const
Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn.
Definition: ldif.h:132

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kabc

Skip menu "kabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kabc by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |