Skip to content

ArcadeExpression Class

  • ArcadeExpression
  • class Esri::ArcGISRuntime::ArcadeExpression

    An Arcade expression object, containing an expression, a name, a return type and a title. More...

    Header: #include <ArcadeExpression.h>
    Since: Esri::ArcGISRuntime 100.11
    Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable

    Public Functions

    ArcadeExpression(const QString &expression, QObject *parent = nullptr)
    ArcadeExpression(const QString &expression, const QString &title, const QString &name, QObject *parent = nullptr)
    ArcadeExpression(const QString &expression, const QString &title, const QString &name, Esri::ArcGISRuntime::ArcadeExpressionReturnType returnType, QObject *parent = nullptr)
    virtual ~ArcadeExpression() override
    QString expression() const
    QString name() const
    Esri::ArcGISRuntime::ArcadeExpressionReturnType returnType() const
    QString title() const
    (since Esri::ArcGISRuntime 200.7) bool operator!=(Esri::ArcGISRuntime::ArcadeExpression *other) const
    (since Esri::ArcGISRuntime 200.7) bool operator==(Esri::ArcGISRuntime::ArcadeExpression *other) const

    Reimplemented Public Functions

    virtual QString toJson() const override
    (deprecated) virtual QJsonObject unknownJson() const override
    (deprecated) virtual QJsonObject unsupportedJson() const override

    Static Public Members

    Esri::ArcGISRuntime::ArcadeExpression *fromJson(const QString &json, QObject *parent = nullptr)

    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:

    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.

    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.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.