KItinerary::ExtractorValidator

Search for usage in LXR

KItinerary::ExtractorValidator Class Reference

#include <extractorvalidator.h>

Public Member Functions

 ExtractorValidator (const ExtractorValidator &)=delete
 
 ExtractorValidator (ExtractorValidator &&) noexcept
 
bool isValidElement (const QVariant &elem) const
 
ExtractorValidatoroperator= (const ExtractorValidator &)=delete
 
ExtractorValidatoroperator= (ExtractorValidator &&) noexcept
 
template<typename ... Args>
void setAcceptedTypes ()
 
void setAcceptedTypes (std::vector< const QMetaObject * > &&accptedTypes)
 
void setAcceptOnlyCompleteElements (bool completeOnly)
 

Detailed Description

Validates extractor results.

Used to discard incomplete or otherwise invalid data.

Since
20.08

Definition at line 25 of file extractorvalidator.h.

Constructor & Destructor Documentation

◆ ExtractorValidator()

ExtractorValidator::ExtractorValidator ( )

Definition at line 51 of file extractorvalidator.cpp.

Member Function Documentation

◆ isValidElement()

bool ExtractorValidator::isValidElement ( const QVariant & elem) const
nodiscard

Checks if the given element is valid.

This will accept both Reservation object and things that can be reserved as top-level objects.

Definition at line 230 of file extractorvalidator.cpp.

◆ setAcceptedTypes() [1/2]

template<typename ... Args>
void KItinerary::ExtractorValidator::setAcceptedTypes ( )
inline

Convenience overload of setAcceptedTypes().

Definition at line 48 of file extractorvalidator.h.

◆ setAcceptedTypes() [2/2]

void ExtractorValidator::setAcceptedTypes ( std::vector< const QMetaObject * > && accptedTypes)

Sets the list of supported top-level types that should be accepted.

Providing an empty set of types will accept all top-level types. Instances of types inheriting from accepted types are also accepted. Default is to accept all types.

Definition at line 59 of file extractorvalidator.cpp.

◆ setAcceptOnlyCompleteElements()

void ExtractorValidator::setAcceptOnlyCompleteElements ( bool completeOnly)

Configure whether or not to accept also incomplete elements.

The default is true. Accepting incomplete elements is useful if the output is further processed, for example to merge minimal cancellation elements with already existing data. If the output is displayed directly, set this to true.

Definition at line 64 of file extractorvalidator.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:00:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.