KFileMetaData 5.109.0
|
A simple ExtractionResult implementation which stores all the data in memory. More...
#include <KFileMetaData/SimpleExtractionResult>
Public Member Functions | |
SimpleExtractionResult (const QString &url, const QString &mimetype=QString(), const Flags &flags=Flags{ExtractPlainText|ExtractMetaData}) | |
SimpleExtractionResult (const SimpleExtractionResult &rhs) | |
void | add (Property::Property property, const QVariant &value) override |
This function is called by the plugins when they wish to add a key value pair which should be indexed. | |
void | addType (Type::Type type) override |
This function is called by the plugins. | |
void | append (const QString &text) override |
This function is called by plugins when they wish for some plain text to be indexed without any property. | |
SimpleExtractionResult & | operator= (const SimpleExtractionResult &rhs) |
bool | operator== (const SimpleExtractionResult &rhs) const |
PropertyMultiMap | properties (PropertiesMapType=PropertiesMapType::MultiMap) const |
Returns the properties of the extraction result. | |
QString | text () const |
QVector< Type::Type > | types () const |
![]() | |
ExtractionResult (const ExtractionResult &rhs) | |
ExtractionResult (const QString &url, const QString &mimetype=QString(), const Flags &flags=Flags{ExtractPlainText|ExtractMetaData}) | |
Create an ExtractionResult which can be passed be to Extractors. | |
virtual void | add (Property::Property property, const QVariant &value)=0 |
This function is called by the plugins when they wish to add a key value pair which should be indexed. | |
void | addImageData (QMap< EmbeddedImageData::ImageType, QByteArray > &&images) |
This function is called by the plugins. | |
virtual void | addType (Type::Type type)=0 |
This function is called by the plugins. | |
virtual void | append (const QString &text)=0 |
This function is called by plugins when they wish for some plain text to be indexed without any property. | |
QMap< EmbeddedImageData::ImageType, QByteArray > | imageData () const |
Return embedded image data. | |
Flags | inputFlags () const |
The flags which the extraction plugin should considering following when extracting metadata from the file. | |
QString | inputMimetype () const |
The input mimetype. | |
QString | inputUrl () const |
The input url which the plugins will use to locate the file. | |
Additional Inherited Members | |
![]() | |
enum | Flag { ExtractNothing = 0 , ExtractMetaData = 1 , ExtractPlainText = 2 , ExtractImageData = 4 , ExtractEverything = (ExtractMetaData | ExtractPlainText) } |
typedef QFlags< Flag > | Flags |
Stores a combination of Flag values. | |
A simple ExtractionResult implementation which stores all the data in memory.
This should ideally not be used in production applications as it holds all of the plain text in memory, and that can get quite large when extracting certain documents.
|
overridevirtual |
This function is called by the plugins when they wish to add a key value pair which should be indexed.
This function may be called multiple times for the same key.
property
This specifies a property name. It should be one of the properties from the global list of properties.
value
The value of the property
Implements KFileMetaData::ExtractionResult.
|
overridevirtual |
This function is called by the plugins.
A type is a higher level classification of the file. A file can have multiple types, but mostly when it does, those types are related. Eg - Document and Presentation.
Please choose one type from the list of available types
Implements KFileMetaData::ExtractionResult.
|
overridevirtual |
This function is called by plugins when they wish for some plain text to be indexed without any property.
This generally corresponds to the text content in a file
Implements KFileMetaData::ExtractionResult.
PropertyMultiMap KFileMetaData::SimpleExtractionResult::properties | ( | PropertiesMapType | = PropertiesMapType::MultiMap | ) | const |
Returns the properties of the extraction result.
Because QMap::insertMulti is deprecated, this overload returns a QMultiMap. To automaticalls use the overload with the default value, define the KFILEMETADATA_DISABLE_DEPRECATED_BEFORE_AND_AT in the cmake code to the deprecating version of this method or greater. For example: