Nepomuk-Core
#include <extractorplugin.h>
Public Types | |
enum | ExtractingCritera { BasicMimeType = 1, Custom = 2 } |
Public Member Functions | |
ExtractorPlugin (QObject *parent) | |
virtual | ~ExtractorPlugin () |
virtual ExtractingCritera | criteria () |
virtual SimpleResourceGraph | extract (const QUrl &resUri, const QUrl &fileUrl, const QString &mimeType)=0 |
virtual QStringList | mimetypes () |
virtual bool | shouldExtract (const QUrl &url, const QString &mimeType) |
Static Public Member Functions | |
static QList< SimpleResource > | contactsFromString (const QString &string) |
static QDateTime | dateTimeFromString (const QString &dateString) |
static int | maxPlainTextSize () |
static void | resetMaxPlainTextSize () |
static void | setMaxPlainTextSize (int size) |
Detailed Description
The ExtractorPlugin is the base class for all file metadata extractors.
It is responsible for extracting the metadata and providing it to Nepomuk.
Make sure to implement either mimetypes or the shouldExtract function and update the indexingCriteria accordingly
Definition at line 60 of file extractorplugin.h.
Member Enumeration Documentation
Each Plugin provides an extracting critera which determines when the plugin should be called.
Definition at line 71 of file extractorplugin.h.
Constructor & Destructor Documentation
Nepomuk2::ExtractorPlugin::ExtractorPlugin | ( | QObject * | parent | ) |
Definition at line 31 of file extractorplugin.cpp.
|
virtual |
Definition at line 35 of file extractorplugin.cpp.
Member Function Documentation
|
static |
Creates a list of nco:Contacts from a list of strings which are separated by a number of different separators.
It sets the contact's nco:fullname.
Definition at line 88 of file extractorplugin.cpp.
|
virtual |
Returns the critera that is being used for determining if this plugin can index the files provided to it.
By default this returns BasicMimeType
- See also
- mimetypes
- shouldExtract
Reimplemented in Nepomuk2::PlainTextExtractor.
Definition at line 39 of file extractorplugin.cpp.
|
static |
Tries to extract a valid date time from the string provided.
Definition at line 59 of file extractorplugin.cpp.
|
pure virtual |
The main function of the plugin that is responsible for extracting the data from the file url and returning a SimpleResourceGraph.
It does so on the basis of the mimetype provided.
- Parameters
-
resUri The resource uri of the fileUrl which should be used in the SimpleResource fileUrl The url of the file being indexed mimeType the mimetype of the file url
Implemented in Nepomuk2::PopplerExtractor, Nepomuk2::Office2007Extractor, Nepomuk2::PlainTextExtractor, Nepomuk2::Exiv2Extractor, Nepomuk2::OdfExtractor, Nepomuk2::OfficeExtractor, Nepomuk2::EPubExtractor, Nepomuk2::FFmpegExtractor, Nepomuk2::MobiExtractor, and Nepomuk2::TagLibExtractor.
|
static |
Virtuoso does not support streaming operators, and does not accept queries above a certain size.
Since the plain text has to go in a query, there is no point extracting more than this plain text
Definition at line 124 of file extractorplugin.cpp.
|
virtual |
Provide a list of mimetypes which are supported by this plugin.
Only files with those mimetypes will be provided to the plugin via the extract function.
- Returns
- A StringList containing the mimetypes.
- See also
- extract
Reimplemented in Nepomuk2::PopplerExtractor, Nepomuk2::Exiv2Extractor, Nepomuk2::Office2007Extractor, Nepomuk2::EPubExtractor, Nepomuk2::FFmpegExtractor, Nepomuk2::MobiExtractor, Nepomuk2::TagLibExtractor, Nepomuk2::OdfExtractor, and Nepomuk2::OfficeExtractor.
Definition at line 44 of file extractorplugin.cpp.
|
static |
Definition at line 129 of file extractorplugin.cpp.
|
static |
Definition at line 134 of file extractorplugin.cpp.
|
virtual |
By default this returns true if mimetype
is in the list of mimetypes provided by the plugin.
If this function has been reimplemented then the ExtractingCritera should be changed.
Reimplemented in Nepomuk2::PlainTextExtractor.
Definition at line 49 of file extractorplugin.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.