Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KMimeTypeValidator Class Reference

A QValidator for mime types. More...

#include <kstringvalidator.h>

List of all members.

Public Methods

virtual State validate (QString &input, int &pos) const
virtual void fixup (QString &input) const


Detailed Description

A QValidator for mime types.

This validator allows you to validate mimetype names (e.g. text/plain, image/jpeg). Note that the validation is only syntactically. It will e.g. not reject "foo/bar", although that particular mime type isn't yet registered. It suffices for the name to adhere to the production

 mime-type := token "/" token ; 'token' is defined in rfc2045
 

The fixup will simply remove all non-token characters.

Author:
Marc Mutz <mutz@kde.org>

Definition at line 112 of file kstringvalidator.h.


Member Function Documentation

virtual void KMimeTypeValidator::fixup QString &    input const [virtual]
 

Removes all characters that are forbidden in mimetypes.

virtual State KMimeTypeValidator::validate QString &    input,
int &    pos
const [virtual]
 

Checks for well-formed mimetype. Returns

  • Acceptable iff input ~= /^[:allowed chars:]+\/[:allowed chars:]+$/
  • Intermediate iff input ~= /^[:allowed chars:]*\/?[:allowed chars:]*$/
  • Invalid else


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:19 2003 for kdelibs by doxygen1.2.18