KFileMetaData 5.109.0
Public Member Functions | List of all members
KFileMetaData::SimpleExtractionResult

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.
 
SimpleExtractionResultoperator= (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
 

Additional Inherited Members

Detailed Description

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.

Member Function Documentation

◆ add()

void KFileMetaData::SimpleExtractionResult::add ( Property::Property  property,
const QVariant &  value 
)
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.

◆ addType()

void KFileMetaData::SimpleExtractionResult::addType ( Type::Type  type)
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.

◆ append()

void KFileMetaData::SimpleExtractionResult::append ( const QString &  text)
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.

◆ properties()

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:

add_definitions(-DKFILEMETADATA_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900)
Since
5.89