An Arcade expression object, containing an expression, a name, a return type and a title. More...
| Header | #include <Arcade |
| Since | Esri |
| Inherits | Esri |
Public Functions
| Arcade | |
| Arcade | |
| Arcade | |
| virtual | ~ |
| Q | expression() const |
| Q | name() const |
| Esri | return |
| Q | title() const |
(since Esri bool | operator!=( |
(since Esri bool | operator==( |
Reimplemented Public Functions
| virtual Q | to |
(deprecated) virtual Q | unknown |
(deprecated) virtual Q | unsupported |
Static Public Members
| Esri | from |
Detailed Description
An ArcadeExpression object gathers an Arcade script expression together with: - the expected return type - the name that a map author uses to refer to it - the title that the author uses to describe the expression
Relevant samples:
- Query features with Arcade expression: Query features on a map using an Arcade expression.
- Set up location-driven Geotriggers: Create a notification every time a given location data source has entered and/or exited a set of features or graphics.
Member Function Documentation
[explicit] ArcadeExpression::ArcadeExpression (const QString &expression, QObject *parent = nullptr)
Creates a new Arcade expression object with an expression script.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return empty.
- parent - The optional parent QObject.
The name and title will default to empty strings. The returnType will default to ArcadeExpressionReturnType::Automatic.
ArcadeExpression::ArcadeExpression (const QString &expression, const QString &title, const QString &name, QObject *parent = nullptr)
Creates a new Arcade expression with an expression string, title, and name.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return empty.
- title - The title of the expression.
- name - The name of the expression.
- parent - The optional parent QObject.
The returnType will default to ArcadeExpressionReturnType::Automatic.
ArcadeExpression::ArcadeExpression (const QString &expression, const QString &title, const QString &name, Esri::ArcGISRuntime::ArcadeExpressionReturnType returnType , QObject *parent = nullptr)
Creates a new Arcade expression with an expression string, title, name, and return type.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return zero,
false, an empty string, or empty, depending on whether the returnType is ArcadeExpressionReturnType::Number, ArcadeExpressionReturnType::Boolean, ArcadeExpressionReturnType::String or anything else, respectively. - title - The title of the expression.
- name - The name of the expression.
- returnType - The type to cast the evaluated value to.
- parent - The optional parent QObject.
If the Arcade expression evaluates to a result which differs from ArcadeExpressionReturnType then the result will be cast to the expected return type.
If the cast cannot be carried out, the result will be a type-specific error value. See ArcadeExpressionReturnType for details.
[override virtual noexcept] ArcadeExpression::~ArcadeExpression ()
Destructor.
QString ArcadeExpression::expression() const
Returns the Arcade expression string.
[static] Esri::ArcGISRuntime::ArcadeExpression *ArcadeExpression::fromJson (const QString &json, QObject *parent = nullptr)
Creates a new ArcadeExpression from json with an optional parent.
See also JsonSerializable.
QString ArcadeExpression::name() const
Returns the name that the author uses to refer to the expression.
If not set explicitly, then the default is an empty name string.
Esri::ArcGISRuntime::ArcadeExpressionReturnType ArcadeExpression::returnType () const
Returns the expected return type of the expression.
If the Arcade expression creates results of a different type (for example, a Date or an Array), then the result will be cast to the expected return type. If the cast cannot be carried out, the result will be a type-specific error value. ArcadeExpressionReturnType for details.
QString ArcadeExpression::title() const
Returns the title that the author uses to describe the expression.
If not set explicitly, then the default is an empty title string.
[override virtual] QString ArcadeExpression::toJson () const
Reimplements: JsonSerializable::toJson() const.
Converts and returns an object to JSON string.
See also JsonSerializable.
[since Esri::ArcGISRuntime 200.7] bool ArcadeExpression::operator!=(Esri::ArcGISRuntime::ArcadeExpression *other) const
Tests and returns true if this object is not equal to a second ArcadeExpression object.
- other - The second object.
This function was introduced in Esri::ArcGISRuntime 200.7.
[since Esri::ArcGISRuntime 200.7] bool ArcadeExpression::operator==(Esri::ArcGISRuntime::ArcadeExpression *other) const
Tests and returns true if this object is equal to a second ArcadeExpression object.
- other - The second object.
This function was introduced in Esri::ArcGISRuntime 200.7.