Pages
API Documentation
On this page

KFileMetaData::ExtractionResult Class

The ExtractionResult class is where all the data extracted by the indexer is saved. More...

  • Header: #include <KFileMetaData/ExtractionResult>
  • CMake: find_package(KF6 REQUIRED COMPONENTS FileMetaData)
    target_link_libraries(mytarget PRIVATE KF6::FileMetaData)
  • Inherited By: KFileMetaData::SimpleExtractionResult

List of all members, including inherited members

Public Types

Public Functions

Detailed Description

This class acts as a base class which should be derived from and then passed to the relevant plugins.

The derived class needs to implement 3 pure virtual functions through which it receives the extracted data.

Member Type Documentation

enum ExtractionResult::Flag

flags ExtractionResult::Flags

Constant
KFileMetaData::ExtractionResult::ExtractNothing 0
KFileMetaData::ExtractionResult::ExtractMetaData 1
KFileMetaData::ExtractionResult::ExtractPlainText 2
KFileMetaData::ExtractionResult::ExtractImageData (since Qt 5.76) 4

The Flags type is a typedef for QFlags<Flag>. It stores an OR combination of Flag values.

Member Function Documentation

ExtractionResult::ExtractionResult(const QString &url, const QString &mimetype = QString(), const KFileMetaData::ExtractionResult::Flags &flags = Flags{ExtractPlainText | ExtractMetaData})

Create an ExtractionResult which can be passed be to Extractors. The extractors use the url, mimetype and flags in order to determine which file the data should be extracted from and which data should be extracted.

[pure virtual] void ExtractionResult::add(KFileMetaData::Property::Property property, const QVariant &value)

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

void ExtractionResult::addImageData(QMap<KFileMetaData::EmbeddedImageData::ImageType, QByteArray> &&images)

This function is called by the plugins.

images The images to add

See also EmbeddedImageData

[pure virtual] void ExtractionResult::addType(KFileMetaData::Type::Type type)

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

[pure virtual] void ExtractionResult::append(const QString &text)

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

QMap<KFileMetaData::EmbeddedImageData::ImageType, QByteArray> ExtractionResult::imageData() const

Return embedded image data

KFileMetaData::ExtractionResult::Flags ExtractionResult::inputFlags() const

The flags which the extraction plugin should considering following when extracting metadata from the file

QString ExtractionResult::inputMimetype() const

The input MIME type. This MIME type should correspond with the MIME types supported with the relevant plugin when it is being passed to the Extractor, or be a subtype thereof.

See also ExtractorCollection::fetchExtractors, ExtractorPlugin::supportedMimeType

QString ExtractionResult::inputUrl() const

The input URL which the plugins will use to locate the file

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.