org.kde.koala

Class KMimeTypeValidator

public class KMimeTypeValidator extends QValidator

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

UNKNOWN: A QValidator for mime types.

Constructor Summary
protected KMimeTypeValidator(Class dummy)
KMimeTypeValidator(QObject parent, String name)
KMimeTypeValidator(QObject parent)
Method Summary
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
voidfixup(StringBuffer input)
Removes all characters that are forbidden in mimetypes.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
intvalidate(StringBuffer input, int[] pos)
Checks for well-formed mimetype.

Constructor Detail

KMimeTypeValidator

protected KMimeTypeValidator(Class dummy)

KMimeTypeValidator

public KMimeTypeValidator(QObject parent, String name)

KMimeTypeValidator

public KMimeTypeValidator(QObject parent)

Method Detail

className

public String className()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

fixup

public void fixup(StringBuffer input)
Removes all characters that are forbidden in mimetypes.

UNKNOWN: Removes all characters that are forbidden in mimetypes.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

validate

public int validate(StringBuffer input, int[] pos)
Checks for well-formed mimetype. Returns
  • Acceptable iff input ~= /^[:allowed chars:]+\/[:allowed chars:]+$/
  • Intermediate iff input ~= /^[:allowed chars:]\/?[:allowed chars:]$/
  • Invalid else
  • @short Checks for well-formed mimetype.