![]() |
|
Class responsible for parsing and evaluating variable expressions. More...
#include <variableExpression.h>
Class responsible for parsing and evaluating variable expressions.
Variable expressions are written in a custom language and represented in scene description as a string surrounded by backticks (). / These expressions may refer to "expression variables", which are key-value / pairs provided by clients. For example, when evaluating an expression like: / / \code ///"a_${NAME}_string"‘ /// / / The "${NAME}" portion of the string with the value of expression variable / "NAME". / / Expression variables may be any of these supported types: / / - std::string / - int64_t (int is accepted but coerced to int64_t) / - bool / - VtArrays containing any of the above types. / - None (represented by an empty VtValue) / / Expression variables are typically authored in scene description as layer / metadata under the 'expressionVariables’ field. Higher levels of the system / (e.g., composition) are responsible for examining fields that support / variable expressions, evaluating them with the appropriate variables (via / this class) and consuming the results. / / See Variable Expressions / or more information on the expression language and areas of the system / where expressions may be used. class SdfVariableExpression { public: / Construct using the expression expr. If the expression cannot be / parsed, this object represents an invalid expression. Parsing errors / will be accessible via GetErrors. SDF_API explicit SdfVariableExpression(const std::string& expr);
/This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. SDF_API explicit SdfVariableExpression(std::string&& expr);
/ Construct an object representing an invalid expression. SDF_API SdfVariableExpression();
SDF_API ~SdfVariableExpression();
/ Returns true if s is a variable expression, false otherwise. / A variable expression is a string surrounded by backticks (`).