[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Member Functions

KLFLibLocalFileSchemeGuesser Class Reference

Interface for guessing file schemes. More...

#include <klflibview.h>

Inheritance diagram for KLFLibLocalFileSchemeGuesser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 KLFLibLocalFileSchemeGuesser ()
virtual ~KLFLibLocalFileSchemeGuesser ()
virtual QString guessScheme (const QString &fileName) const =0
 Guess the appropriate scheme for handling the given file.

Detailed Description

Interface for guessing file schemes.

This class provides the basic interface for customizing known local file types, and guessing their corresponding schemes.

To add a scheme guesser, just reimplement this function and create an instance of it. It will register automatically.

To query [all guessers instances] the scheme to use for a filename, use KLFLibBasicWidgetFactory::guessLocalFileScheme().

Definition at line 1092 of file klflibview.h.


Constructor & Destructor Documentation

KLFLibLocalFileSchemeGuesser::KLFLibLocalFileSchemeGuesser ( )
KLFLibLocalFileSchemeGuesser::~KLFLibLocalFileSchemeGuesser ( ) [virtual]

Member Function Documentation

virtual QString KLFLibLocalFileSchemeGuesser::guessScheme ( const QString fileName) const [pure virtual]

Guess the appropriate scheme for handling the given file.

Reimplentations of this function must guess what scheme fileName is to be opened with.

By scheme we mean the URL scheme, ie. the scheme that the correct subclass of KLFLibEngineFactory reports being capable of opening (eg. "klf+sqlite").

In reimplementations of this function, first the filename extension should be checked. If it is not known, then the file can be peeked into for magic headers.

If the scheme cannot be guessed, then the reimplementation should return an empty string.

Note:
the fileName does not necessarily exist. (keep that in mind before reporting an error that you can't open the file to read a magic header). In that case, a simple test should be performed on the file extension.

Implemented in KLFLibDBLocalFileSchemeGuesser, and KLFLibLegacyLocalFileSchemeGuesser.


The documentation for this class was generated from the following files:

Generated by doxygen 1.7.3