\section{KABC::LDIF Class Reference}
\label{classKABC_1_1LDIF}\index{KABC::LDIF@{KABC::LDIF}}
{\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})}.  


{\tt \#include $<$ldif.h$>$}

Collaboration diagram for KABC::LDIF:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=136pt]{classKABC_1_1LDIF__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Parse\-Val} \{ \par
{\bf None}, 
{\bf New\-Entry}, 
{\bf End\-Entry}, 
{\bf Item}, 
\par
{\bf Control}, 
{\bf Err}, 
{\bf More\-Data}
 \}
\item 
enum {\bf Entry\-Type} \{ \par
{\bf Entry\_\-None}, 
{\bf Entry\_\-Add}, 
{\bf Entry\_\-Del}, 
{\bf Entry\_\-Mod}, 
\par
{\bf Entry\_\-Modrdn}
 \}
\item 
enum {\bf Mod\-Type} \{ {\bf Mod\_\-None}, 
{\bf Mod\_\-Add}, 
{\bf Mod\_\-Replace}, 
{\bf Mod\_\-Del}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf start\-Parsing} ()
\item 
Parse\-Val {\bf process\-Line} ()
\item 
Parse\-Val {\bf next\-Item} ()
\item 
void {\bf set\-LDIF} (const {\bf QByte\-Array} \&ldif)
\item 
void {\bf end\-LDIF} ()
\item 
Entry\-Type {\bf entry\-Type} () const 
\item 
int {\bf mod\-Type} () const 
\item 
const {\bf QString} \& {\bf dn} () const 
\item 
const {\bf QString} \& {\bf new\-Rdn} () const 
\item 
const {\bf QString} \& {\bf new\-Superior} () const 
\item 
bool {\bf del\-Old\-Rdn} () const 
\item 
const {\bf QString} \& {\bf attr} () const 
\item 
const {\bf QByte\-Array} \& {\bf val} () const 
\item 
bool {\bf is\-Url} () const 
\item 
bool {\bf critical} () const 
\item 
const {\bf QString} \& {\bf oid} () const 
\item 
uint {\bf line\-No} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QCString} {\bf assemble\-Line} (const {\bf QString} \&fieldname, const {\bf QByte\-Array} \&value, uint linelen=0, bool url=false)
\item 
static {\bf QCString} {\bf assemble\-Line} (const {\bf QString} \&fieldname, const {\bf QCString} \&value, uint linelen=0, bool url=false)
\item 
static {\bf QCString} {\bf assemble\-Line} (const {\bf QString} \&fieldname, const {\bf QString} \&value, uint linelen=0, bool url=false)
\item 
static bool {\bf split\-Line} (const {\bf QCString} \&line, {\bf QString} \&fieldname, {\bf QByte\-Array} \&value)
\item 
static bool {\bf split\-Control} (const {\bf QCString} \&line, {\bf QString} \&oid, bool \&critical, {\bf QByte\-Array} \&value)
\end{CompactItemize}


\subsection{Detailed Description}
{\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})}. 

{\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} implements an RFC 2849 compliant {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} parser. {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} files are used to represent directory information on LDAP-based servers, or to describe a set of changes which are to be applied to a directory. 



Definition at line 40 of file ldif.h.

\subsection{Member Function Documentation}
\index{KABC::LDIF@{KABC::LDIF}!assembleLine@{assembleLine}}
\index{assembleLine@{assembleLine}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} LDIF::assemble\-Line (const {\bf QString} \& {\em fieldname}, const {\bf QByte\-Array} \& {\em value}, uint {\em linelen} = {\tt 0}, bool {\em url} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKABC_1_1LDIF_e0}


Assembles fieldname and value into a valid {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} line, BASE64 encodes the value if neccessary and optionally splits into more lines. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fieldname}]The name of the entry. \item[{\em value}]The value of the entry. \item[{\em linelen}]Maximum length of the lines in the result. \item[{\em url}]If true, encode value as url ( use :$<$ ). \end{description}
\end{Desc}


Definition at line 37 of file ldif.cpp.

References KCodecs::base64Encode(), QCString::insert(), QCString::length(), and QCString::lower().

Referenced by assemble\-Line().\index{KABC::LDIF@{KABC::LDIF}!assembleLine@{assembleLine}}
\index{assembleLine@{assembleLine}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} LDIF::assemble\-Line (const {\bf QString} \& {\em fieldname}, const {\bf QCString} \& {\em value}, uint {\em linelen} = {\tt 0}, bool {\em url} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKABC_1_1LDIF_e1}


This is the same as the above function, the only difference that this accepts {\bf QCString} as the value. 



Definition at line 85 of file ldif.cpp.

References assemble\-Line(), and QCString::length().\index{KABC::LDIF@{KABC::LDIF}!assembleLine@{assembleLine}}
\index{assembleLine@{assembleLine}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} LDIF::assemble\-Line (const {\bf QString} \& {\em fieldname}, const {\bf QString} \& {\em value}, uint {\em linelen} = {\tt 0}, bool {\em url} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKABC_1_1LDIF_e2}


This is the same as the above function, the only difference that this accepts {\bf QString} as the value. 



Definition at line 100 of file ldif.cpp.

References assemble\-Line().\index{KABC::LDIF@{KABC::LDIF}!splitLine@{splitLine}}
\index{splitLine@{splitLine}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool LDIF::split\-Line (const {\bf QCString} \& {\em line}, {\bf QString} \& {\em fieldname}, {\bf QByte\-Array} \& {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKABC_1_1LDIF_e3}


Splits one line from an {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} file to attribute and value components. 

\begin{Desc}
\item[Returns:]true if value is an URL, false otherwise \end{Desc}


Definition at line 106 of file ldif.cpp.

References KCodecs::base64Decode(), QCString::find(), QString::from\-Utf8(), QCString::left(), QCString::length(), QCString::resize(), and QCString::strip\-White\-Space().

Referenced by process\-Line(), and split\-Control().\index{KABC::LDIF@{KABC::LDIF}!splitControl@{splitControl}}
\index{splitControl@{splitControl}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool LDIF::split\-Control (const {\bf QCString} \& {\em line}, {\bf QString} \& {\em oid}, bool \& {\em critical}, {\bf QByte\-Array} \& {\em value})\hspace{0.3cm}{\tt  [static]}}\label{classKABC_1_1LDIF_e4}


Splits a control specification (without the \char`\"{}control:\char`\"{} directive). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em line}]is the control directive \item[{\em oid}]will contain the OID \item[{\em critical}]will contain the criticality of control \item[{\em value}]is the control value \end{description}
\end{Desc}


Definition at line 174 of file ldif.cpp.

References critical(), endl(), QString::from\-Utf8(), QString::is\-Empty(), kd\-Debug(), QString::length(), oid(), QString::right(), split\-Line(), and QString::truncate().

Referenced by process\-Line().\index{KABC::LDIF@{KABC::LDIF}!startParsing@{startParsing}}
\index{startParsing@{startParsing}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LDIF::start\-Parsing ()}\label{classKABC_1_1LDIF_a2}


Starts the parsing of a new {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})}. 



Definition at line 354 of file ldif.cpp.\index{KABC::LDIF@{KABC::LDIF}!processLine@{processLine}}
\index{processLine@{processLine}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}LDIF::Parse\-Val LDIF::process\-Line ()}\label{classKABC_1_1LDIF_a3}


Process one {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} line. 



Definition at line 197 of file ldif.cpp.

References endl(), QString::from\-Utf8(), QString::is\-Empty(), kd\-Debug(), QString::lower(), split\-Control(), and split\-Line().

Referenced by next\-Item().\index{KABC::LDIF@{KABC::LDIF}!nextItem@{nextItem}}
\index{nextItem@{nextItem}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}LDIF::Parse\-Val LDIF::next\-Item ()}\label{classKABC_1_1LDIF_a4}


Process the {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} until a complete item can be returned. 

\begin{Desc}
\item[Returns:]New\-Entry if a new DN encountered, Item if a new item returned, Err if the {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} contains error, End\-Entry if the parser reached the end of the current entry and More\-Data if the parser encountered the end of the current chunk of the {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})}. If you want to finish the parsing after receiving More\-Data, then call {\bf end\-LDIF()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a6})}, so the parser can safely flush the current entry. \end{Desc}


Definition at line 308 of file ldif.cpp.

References process\-Line(), and QCString::resize().\index{KABC::LDIF@{KABC::LDIF}!setLDIF@{setLDIF}}
\index{setLDIF@{setLDIF}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::LDIF::set\-LDIF (const {\bf QByte\-Array} \& {\em ldif})\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a5}


Sets a chunk of {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})}. 

Call before {\bf start\-Parsing()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a2})}, or if {\bf next\-Item()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a4})} returned More\-Data. 

Definition at line 111 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!endLDIF@{endLDIF}}
\index{endLDIF@{endLDIF}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LDIF::end\-LDIF ()}\label{classKABC_1_1LDIF_a6}


Indicates the end of the {\bf LDIF}{\rm (p.\,\pageref{classKABC_1_1LDIF})} file/stream. 

Call if {\bf next\-Item()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a4})} returned More\-Data, but actually you don't have more data. 

Definition at line 344 of file ldif.cpp.\index{KABC::LDIF@{KABC::LDIF}!entryType@{entryType}}
\index{entryType@{entryType}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Entry\-Type KABC::LDIF::entry\-Type () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a7}


Returns the requested LDAP operation extracted from the current entry. 



Definition at line 120 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!modType@{modType}}
\index{modType@{modType}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KABC::LDIF::mod\-Type () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a8}


Returns the LDAP modify request type if {\bf entry\-Type()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a7})} returned Entry\_\-Mod. 



Definition at line 124 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!dn@{dn}}
\index{dn@{dn}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KABC::LDIF::dn () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a9}


Returns the Distinguished Name of the current entry. 



Definition at line 128 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!newRdn@{newRdn}}
\index{newRdn@{newRdn}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KABC::LDIF::new\-Rdn () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a10}


Returns the new Relative Distinguished Name if {\bf mod\-Type()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a8})} returned Entry\_\-Modrdn. 



Definition at line 132 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!newSuperior@{newSuperior}}
\index{newSuperior@{newSuperior}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KABC::LDIF::new\-Superior () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a11}


Returns the new parent of the entry if {\bf mod\-Type()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a8})} returned Entry\_\-Modrdn. 



Definition at line 136 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!delOldRdn@{delOldRdn}}
\index{delOldRdn@{delOldRdn}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::LDIF::del\-Old\-Rdn () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a12}


Returns if the delete of the old RDN is required. 



Definition at line 140 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!attr@{attr}}
\index{attr@{attr}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KABC::LDIF::attr () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a13}


Returns the attribute name. 



Definition at line 144 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!val@{val}}
\index{val@{val}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QByte\-Array}\& KABC::LDIF::val () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a14}


Returns the attribute value. 



Definition at line 148 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!isUrl@{isUrl}}
\index{isUrl@{isUrl}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::LDIF::is\-Url () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a15}


Returns if {\bf val()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a14})} is an url. 



Definition at line 152 of file ldif.h.\index{KABC::LDIF@{KABC::LDIF}!critical@{critical}}
\index{critical@{critical}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::LDIF::critical () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a16}


Returns the criticality level when {\bf mod\-Type()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a8})} returned Control. 



Definition at line 156 of file ldif.h.

Referenced by split\-Control().\index{KABC::LDIF@{KABC::LDIF}!oid@{oid}}
\index{oid@{oid}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KABC::LDIF::oid () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a17}


Returns the OID when {\bf mod\-Type()}{\rm (p.\,\pageref{classKABC_1_1LDIF_a8})} returned Control. 



Definition at line 160 of file ldif.h.

Referenced by split\-Control().\index{KABC::LDIF@{KABC::LDIF}!lineNo@{lineNo}}
\index{lineNo@{lineNo}!KABC::LDIF@{KABC::LDIF}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KABC::LDIF::line\-No () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1LDIF_a18}


Returns the line number which the parser processes. 



Definition at line 164 of file ldif.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
ldif.h\item 
ldif.cpp\end{CompactItemize}
