QGIS/python/core/metadata/qgslayermetadatavalidator.sip

98 lines
2.7 KiB
Plaintext
Raw Normal View History

/************************************************************************
* 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 &section, const QString &note, 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;
2017-05-04 07:30:27 +10:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/metadata/qgslayermetadatavalidator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/