Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* replace constexpr (fixes pre-c++11 windows build)
* fix "added in 3.0" annotation
* sip syncs
  • Loading branch information
jef-n committed Nov 26, 2016
1 parent 0cfd7d8 commit 3e73840
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 46 deletions.
52 changes: 38 additions & 14 deletions python/core/qgsexpression.sip
Expand Up @@ -8,7 +8,7 @@ class QgsExpression
/**
* Creates a new expression based on the provided string.
* The string will immediately be parsed. For optimization
* {@link prepare()} should alwys be called before every
* {@link prepare()} should always be called before every
* loop in which this expression is used.
*/
QgsExpression( const QString& expr );
Expand Down Expand Up @@ -49,7 +49,8 @@ class QgsExpression

/**
* Get list of columns referenced by the expression.
* @note if the returned list contains the QgsFeatureRequest::AllAttributes constant then
*
* @note If the returned list contains the QgsFeatureRequest::AllAttributes constant then
* all attributes from the layer are required for evaluation of the expression.
* QgsFeatureRequest::setSubsetOfAttributes automatically handles this case.
*
Expand Down Expand Up @@ -146,17 +147,17 @@ class QgsExpression
*/
static bool isValid( const QString& text, const QgsExpressionContext* context, QString &errorMessage );

void setScale( double scale );

double scale();

/**
* Set the expression string, will reset the whole internal structure.
*
* @note Added in QGIS 2.18
*/
void setExpression( const QString& expression );

void setScale( double scale );

double scale();

//! Return the original, unmodified expression string.
//! If there was none supplied because it was constructed by sole
//! API calls, dump() will be used to create one instead.
Expand All @@ -172,6 +173,7 @@ class QgsExpression
* (used by $length, $area and $perimeter functions only)
* @see setGeomCalculator()
* @see distanceUnits()
* @see areaUnits()
*/
QgsDistanceArea *geomCalculator();

Expand All @@ -188,13 +190,15 @@ class QgsExpression
* @note distances are only converted when a geomCalculator() has been set
* @note added in QGIS 2.14
* @see setDistanceUnits()
* @see areaUnits()
*/
QGis::UnitType distanceUnits() const;

/** Sets the desired distance units for calculations involving geomCalculator(), eg "$length" and "$perimeter".
* @note distances are only converted when a geomCalculator() has been set
* @note added in QGIS 2.14
* @see distanceUnits()
* @see setAreaUnits()
*/
void setDistanceUnits( QGis::UnitType unit );

Expand Down Expand Up @@ -358,7 +362,7 @@ class QgsExpression
//! List of parameters, used for function definition
typedef QList< QgsExpression::Parameter > ParameterList;

/**
/** \ingroup core
* A abstract base class for defining QgsExpression functions.
*/
class Function
Expand All @@ -377,7 +381,7 @@ class QgsExpression
bool isContextual = false );

/** Constructor for function which uses unnamed parameters and group list
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
Function( const QString& fnname,
int params,
Expand All @@ -403,7 +407,7 @@ class QgsExpression
bool isContextual = false );

/** Constructor for function which uses named parameter list and group list.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
Function( const QString& fnname,
const QgsExpression::ParameterList& params,
Expand All @@ -419,6 +423,7 @@ class QgsExpression

/** The name of the function. */
QString name() const;

/** The number of parameters this function takes. */
int params() const;

Expand All @@ -431,6 +436,7 @@ class QgsExpression
const QgsExpression::ParameterList& parameters() const;

/** Does this function use a geometry object. */
//TODO QGIS 3.0 - rename to usesGeometry()
bool usesgeometry() const;

/** Returns a list of possible aliases for the function. These include
Expand All @@ -455,7 +461,7 @@ class QgsExpression

/** Returns true if the function is deprecated and should not be presented as a valid option
* to users in expression builders.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
virtual bool isDeprecated() const;

Expand All @@ -465,12 +471,13 @@ class QgsExpression
QString group() const;

/** Returns a list of the groups the function belongs to.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
* @see group()
*/
QStringList groups() const;

/** The help text for the function. */
//TODO QGIS 3.0 - rename to helpText()
const QString helptext() const;

//! @deprecated Use QgsExpressionContext variant instead
Expand Down Expand Up @@ -684,6 +691,7 @@ class QgsExpression

//! Named node
//! @note added in QGIS 2.16
//! \ingroup core
class NamedNode
{
public:
Expand Down Expand Up @@ -737,7 +745,7 @@ class QgsExpression
//TODO QGIS 3.0 - remove
//! @deprecated use QgsInterval instead
class Interval
{
{
public:
Interval( int seconds = 0 );

Expand Down Expand Up @@ -785,6 +793,8 @@ class QgsExpression
virtual QgsExpression::Node* clone() const;
};

/** \ingroup core
*/
class NodeBinaryOperator : QgsExpression::Node
{
public:
Expand Down Expand Up @@ -820,6 +830,8 @@ class QgsExpression
QDateTime computeDateTimeFromInterval( const QDateTime& d, QgsInterval *i );
};

/** \ingroup core
*/
class NodeInOperator : QgsExpression::Node
{
public:
Expand All @@ -841,6 +853,8 @@ class QgsExpression
virtual QgsExpression::Node* clone() const;
};

/** \ingroup core
*/
class NodeFunction : QgsExpression::Node
{
public:
Expand All @@ -865,6 +879,8 @@ class QgsExpression
static bool validateParams( int fnIndex, QgsExpression::NodeList* args, QString& error );
};

/** \ingroup core
*/
class NodeLiteral : QgsExpression::Node
{
public:
Expand All @@ -884,6 +900,8 @@ class QgsExpression
virtual void accept( QgsExpression::Visitor& v ) const;
};

/** \ingroup core
*/
class NodeColumnRef : QgsExpression::Node
{
public:
Expand All @@ -904,6 +922,8 @@ class QgsExpression
virtual QgsExpression::Node* clone() const;
};

/** \ingroup core
*/
class WhenThen
{
public:
Expand All @@ -919,6 +939,8 @@ class QgsExpression

};

/** \ingroup core
*/
class NodeCondition : QgsExpression::Node
{
public:
Expand All @@ -938,8 +960,10 @@ class QgsExpression

//////

/** Support for visitor pattern - algorithms dealing with the expressions
may be implemented without modifying the Node classes */
/** \ingroup core
* Support for visitor pattern - algorithms dealing with the expressions
* may be implemented without modifying the Node classes
*/
class Visitor
{
public:
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsexpressionfieldbuffer.sip
Expand Up @@ -33,7 +33,7 @@ class QgsExpressionFieldBuffer
* @param index The index of the expression to change
* @param name New name for field
*
* @note added in 3.0
* @note added in 2.18
*/
void renameExpression( int index, const QString& name );

Expand Down
37 changes: 29 additions & 8 deletions python/core/qgsvectorfilewriter.sip
Expand Up @@ -20,6 +20,8 @@ class QgsVectorFileWriter
Hidden
};

/** \ingroup core
*/
class Option
{
public:
Expand All @@ -30,6 +32,8 @@ class QgsVectorFileWriter
QgsVectorFileWriter::OptionType type;
};

/** \ingroup core
*/
class SetOption : QgsVectorFileWriter::Option
{
public:
Expand All @@ -40,6 +44,8 @@ class QgsVectorFileWriter
bool allowNone;
};

/** \ingroup core
*/
class StringOption: QgsVectorFileWriter::Option
{
public:
Expand All @@ -48,6 +54,8 @@ class QgsVectorFileWriter
QString defaultValue;
};

/** \ingroup core
*/
class IntOption: QgsVectorFileWriter::Option
{
public:
Expand All @@ -56,12 +64,16 @@ class QgsVectorFileWriter
int defaultValue;
};

/** \ingroup core
*/
class BoolOption : QgsVectorFileWriter::SetOption
{
public:
BoolOption( const QString& docString, bool defaultValue );
};

/** \ingroup core
*/
class HiddenOption : QgsVectorFileWriter::Option
{
public:
Expand Down Expand Up @@ -106,7 +118,8 @@ class QgsVectorFileWriter
SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
};

/** Interface to convert raw field values to their user-friendly value.
/** \ingroup core
* Interface to convert raw field values to their user-friendly value.
* @note Added in QGIS 2.16
*/
class FieldValueConverter
Expand All @@ -133,7 +146,7 @@ class QgsVectorFileWriter
};

/** Edition capability flags
* @note Added in QGIS 3.0 */
* @note Added in QGIS 2.18 */
enum EditionCapability
{
/** Flag to indicate that a new layer can be added to the dataset */
Expand All @@ -152,7 +165,7 @@ class QgsVectorFileWriter
typedef QFlags<QgsVectorFileWriter::EditionCapability> EditionCapabilities;

/** Enumeration to describe how to handle existing files
@note Added in QGIS 3.0
@note Added in QGIS 2.18
*/
enum ActionOnExistingFile
{
Expand Down Expand Up @@ -259,7 +272,7 @@ class QgsVectorFileWriter

/**
* Options to pass to writeAsVectorFormat()
* @note Added in QGIS 3.0
* @note Added in QGIS 2.18
*/
class SaveVectorOptions
{
Expand Down Expand Up @@ -330,7 +343,7 @@ class QgsVectorFileWriter
* @param options options.
* @param newFilename QString pointer which will contain the new file name created (in case it is different to fileName).
* @param errorMessage pointer to buffer fo error message
* @note added in 3.0
* @note added in 2.18
*/
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
const QString& fileName,
Expand Down Expand Up @@ -411,22 +424,30 @@ class QgsVectorFileWriter

static bool driverMetadata( const QString& driverName, MetaData& driverMetadata );

/**
* Get the ogr geometry type from an internal QGIS wkb type enum.
*
* Will drop M values and convert Z to 2.5D where required.
* @note not available in python bindings
*/
// static OGRwkbGeometryType ogrTypeFromWkbType( QgsWKBTypes::Type type );

/**
* Return edition capabilites for an existing dataset name.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
static EditionCapabilities editionCapabilities( const QString& datasetName );

/**
* Returns whether the target layer already exists.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
static bool targetLayerExists( const QString& datasetName,
const QString& layerName );

/**
* Returns whether there are among the attributes specified some that do not exist yet in the layer
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
static bool areThereNewFieldsToCreate( const QString& datasetName,
const QString& layerName,
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayercache.sip
Expand Up @@ -73,7 +73,7 @@ class QgsVectorLayerCache : QObject
* a result of a call to setFullCache() or by through a feature request which resulted in
* all available features being cached.
* @see setFullCache()
* @note added in QGIS 3.0
* @note added in QGIS 2.18
*/
bool hasFullCache() const;

Expand Down Expand Up @@ -107,7 +107,7 @@ class QgsVectorLayerCache : QObject
bool isFidCached( const QgsFeatureId fid ) const;

/** Returns the set of feature IDs for features which are cached.
* @note added in QGIS 3.0
* @note added in QGIS 2.18
* @see isFidCached()
*/
QgsFeatureIds cachedFeatureIds() const;
Expand Down

0 comments on commit 3e73840

Please sign in to comment.