Skip to content
Permalink
Browse files

Dox++

  • Loading branch information
nyalldawson committed Feb 10, 2020
1 parent e93bacd commit 5b639558f45f1e31ea62867044bf41c72b8d2b5c
@@ -410,12 +410,25 @@ Returns the above in friendly format.

virtual void setEncoding( const QString &e );
%Docstring
Set encoding used for accessing data from layer
Set encoding used for accessing data from layer.

An empty encoding string indicates that the provider should automatically
select the most appropriate encoding for the data source.

.. warning::

Support for setting the provider encoding depends on the underlying data
provider. Check capabilities() for the QgsVectorDataProvider.SelectEncoding
capability in order to determine if the provider supports this ability.

.. seealso:: :py:func:`encoding`
%End

QString encoding() const;
%Docstring
Gets encoding which is used for accessing data
Returns the encoding which is used for accessing data.

.. seealso:: :py:func:`setEncoding`
%End

int fieldNameIndex( const QString &fieldName ) const;
@@ -453,7 +453,16 @@ Uses :py:class:`QgsExpression`

void setProviderEncoding( const QString &encoding );
%Docstring
Sets the textencoding of the data provider
Sets the text ``encoding`` of the data provider.

An empty ``encoding`` string indicates that the provider should automatically
select the most appropriate encoding.

.. warning::

Support for setting the provider encoding depends on the underlying data
provider. Check dataProvider().capabilities() for the QgsVectorDataProvider.SelectEncoding
capability in order to determine if the provider supports this ability.
%End

void setCoordinateSystem();
@@ -1010,8 +1010,10 @@ QStringList QgsOgrProvider::_subLayers( bool withFeatureCount ) const
void QgsOgrProvider::setEncoding( const QString &e )
{
QgsSettings settings;
if ( mGDALDriverName == QLatin1String( "ESRI Shapefile" ) ||
( mOgrLayer && !mOgrLayer->TestCapability( OLCStringsAsUTF8 ) ) )

// if the layer has the OLCStringsAsUTF8 capability, we CANNOT override the
// encoding on the QGIS side!
if ( mOgrLayer && !mOgrLayer->TestCapability( OLCStringsAsUTF8 ) )
{
QgsVectorDataProvider::setEncoding( e );
}
@@ -404,12 +404,23 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
QString capabilitiesString() const;

/**
* Set encoding used for accessing data from layer
* Set encoding used for accessing data from layer.
*
* An empty encoding string indicates that the provider should automatically
* select the most appropriate encoding for the data source.
*
* \warning Support for setting the provider encoding depends on the underlying data
* provider. Check capabilities() for the QgsVectorDataProvider::SelectEncoding
* capability in order to determine if the provider supports this ability.
*
* \see encoding()
*/
virtual void setEncoding( const QString &e );

/**
* Gets encoding which is used for accessing data
* Returns the encoding which is used for accessing data.
*
* \see setEncoding()
*/
QString encoding() const;

@@ -582,7 +582,16 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
QgsVectorDataProvider *dataProvider() FINAL;
const QgsVectorDataProvider *dataProvider() const FINAL SIP_SKIP;

//! Sets the textencoding of the data provider
/**
* Sets the text \a encoding of the data provider.
*
* An empty \a encoding string indicates that the provider should automatically
* select the most appropriate encoding.
*
* \warning Support for setting the provider encoding depends on the underlying data
* provider. Check dataProvider().capabilities() for the QgsVectorDataProvider::SelectEncoding
* capability in order to determine if the provider supports this ability.
*/
void setProviderEncoding( const QString &encoding );

//! Setup the coordinate system transformation for the layer

0 comments on commit 5b63955

Please sign in to comment.
You can’t perform that action at this time.