\section{KMime\-Type\-Validator Class Reference}
\label{classKMimeTypeValidator}\index{KMimeTypeValidator@{KMimeTypeValidator}}
This validator allows you to validate mimetype names (e.g. A {\bf QValidator} for mime types.  


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

Inheritance diagram for KMime\-Type\-Validator:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=78pt]{classKMimeTypeValidator__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KMime\-Type\-Validator:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{classKMimeTypeValidator__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KMime\-Type\-Validator} ({\bf QObject} $\ast$parent, const  char $\ast$name=0)\label{classKMimeTypeValidator_a0}

\item 
virtual State {\bf validate} ({\bf QString} \&input, int \&pos) const 
\begin{CompactList}\small\item\em Checks for well-formed mimetype. \item\end{CompactList}\item 
virtual void {\bf fixup} ({\bf QString} \&input) const 
\begin{CompactList}\small\item\em Removes all characters that are forbidden in mimetypes. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This validator allows you to validate mimetype names (e.g. A {\bf QValidator} for mime types. 

text/plain, image/jpeg). Note that the validation is only syntactically. It will e.g. not reject \char`\"{}foo/bar\char`\"{}, although that particular mime type isn't yet registered. It suffices for the name to adhere to the production

\small\begin{alltt}
 mime-type := token "/" token ; 'token' is defined in rfc2045
 \end{alltt}\normalsize 


The fixup will simply remove all non-token characters.

\begin{Desc}
\item[Author:]Marc Mutz $<${\tt mutz@kde.org}$>$ \end{Desc}




Definition at line 112 of file kstringvalidator.h.

\subsection{Member Function Documentation}
\index{KMimeTypeValidator@{KMime\-Type\-Validator}!validate@{validate}}
\index{validate@{validate}!KMimeTypeValidator@{KMime\-Type\-Validator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QValidator::State KMime\-Type\-Validator::validate ({\bf QString} \& {\em input}, int \& {\em pos}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKMimeTypeValidator_a1}


Checks for well-formed mimetype. 

Returns \begin{itemize}
\item Acceptable iff input $\sim$= /$^\wedge$[:allowed chars:]+$\backslash$/[:allowed chars:]+\$/ \item Intermediate iff input $\sim$= /$^\wedge$[:allowed chars:]$\ast$$\backslash$/?[:allowed chars:]$\ast$\$/ \item Invalid else \end{itemize}


Reimplemented from {\bf QValidator}.

Definition at line 66 of file kstringvalidator.cpp.

References QReg\-Exp::exact\-Match(), and QString::is\-Empty().\index{KMimeTypeValidator@{KMime\-Type\-Validator}!fixup@{fixup}}
\index{fixup@{fixup}!KMimeTypeValidator@{KMime\-Type\-Validator}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KMime\-Type\-Validator::fixup ({\bf QString} \& {\em input}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKMimeTypeValidator_a2}


Removes all characters that are forbidden in mimetypes. 



Reimplemented from {\bf QValidator}.

Definition at line 84 of file kstringvalidator.cpp.

References QString::replace().

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