mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
98 lines
2.7 KiB
Plaintext
98 lines
2.7 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/metadata/qgslayermetadatavalidator.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsMetadataValidator
|
|
{
|
|
%Docstring
|
|
Abstract base class for metadata validators.
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslayermetadatavalidator.h"
|
|
%End
|
|
public:
|
|
|
|
struct ValidationResult
|
|
{
|
|
|
|
ValidationResult( const QString §ion, const QString ¬e, const QVariant &identifier = QVariant() );
|
|
%Docstring
|
|
Constructor for ValidationResult.
|
|
%End
|
|
|
|
QString section;
|
|
%Docstring
|
|
Metadata section which failed the validation
|
|
%End
|
|
|
|
QVariant identifier;
|
|
%Docstring
|
|
Optional identifier for the failed metadata item.
|
|
For instance, in list type metadata elements this
|
|
will be set to the list index of the failed metadata
|
|
item.
|
|
%End
|
|
|
|
QString note;
|
|
%Docstring
|
|
The reason behind the validation failure.
|
|
%End
|
|
};
|
|
|
|
virtual ~QgsMetadataValidator();
|
|
|
|
virtual bool validate( const QgsLayerMetadata &metadata, QList< QgsMetadataValidator::ValidationResult > &results /Out/ ) const = 0;
|
|
%Docstring
|
|
Validates a ``metadata`` object, and returns true if the
|
|
metadata is considered valid.
|
|
If validation fails, the ``results`` list will be filled with a list of
|
|
items describing why the validation failed and what needs to be rectified
|
|
to fix the metadata.
|
|
:rtype: bool
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsNativeMetadataValidator : QgsMetadataValidator
|
|
{
|
|
%Docstring
|
|
A validator for the native QGIS metadata schema definition.
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslayermetadatavalidator.h"
|
|
%End
|
|
public:
|
|
|
|
QgsNativeMetadataValidator();
|
|
%Docstring
|
|
Constructor for QgsNativeMetadataValidator.
|
|
%End
|
|
|
|
virtual bool validate( const QgsLayerMetadata &metadata, QList< QgsMetadataValidator::ValidationResult > &results /Out/ ) const;
|
|
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/metadata/qgslayermetadatavalidator.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|