Value Class
(QmlJS::Value)The Value class is an abstract base class for the result of a JS expression. More...
Header: | #include <Value> |
Public Functions
Value() | |
virtual | ~Value() |
virtual void | accept(ValueVisitor *) const = 0 |
virtual const AnchorLineValue * | asAnchorLineValue() const |
virtual const ASTFunctionValue * | asAstFunctionValue() const |
virtual const ASTObjectValue * | asAstObjectValue() const |
virtual const ASTPropertyReference * | asAstPropertyReference() const |
virtual const ASTSignal * | asAstSignal() const |
virtual const ASTVariableReference * | asAstVariableReference() const |
virtual const BooleanValue * | asBooleanValue() const |
virtual const ColorValue * | asColorValue() const |
virtual const CppComponentValue * | asCppComponentValue() const |
virtual const Function * | asFunction() const |
virtual const FunctionValue * | asFunctionValue() const |
virtual const IntValue * | asIntValue() const |
virtual const JSImportScope * | asJSImportScope() const |
virtual const MetaFunction * | asMetaFunction() const |
virtual const NullValue * | asNullValue() const |
virtual const NumberValue * | asNumberValue() const |
virtual const ObjectValue * | asObjectValue() const |
virtual const QmlEnumValue * | asQmlEnumValue() const |
virtual const QmlPrototypeReference * | asQmlPrototypeReference() const |
virtual const Internal::QtObjectPrototypeReference * | asQtObjectPrototypeReference() const |
virtual const RealValue * | asRealValue() const |
virtual const Reference * | asReference() const |
virtual const StringValue * | asStringValue() const |
virtual const TypeScope * | asTypeScope() const |
virtual const UndefinedValue * | asUndefinedValue() const |
virtual const UnknownValue * | asUnknownValue() const |
virtual const UrlValue * | asUrlValue() const |
virtual bool | getSourceLocation(QString *fileName, int *line, int *column) const |
Detailed Description
The Value class is an abstract base class for the result of a JS expression.
A Value represents a category of JavaScript values, such as number (NumberValue), string (StringValue) or functions with a specific signature (FunctionValue). It can also represent internal categories such as "a QML component instantiation defined in a file" (ASTObjectValue), "a QML component defined in C++" (CppComponentValue) or "no specific information is available" (UnknownValue).
The Value class itself provides accept() for admitting ValueVisitors and a do-nothing getSourceLocation().
Value instances should be cast to a derived type either through the asXXX() helper functions such as asNumberValue() or via the value_cast() template function.
Values are the result of many operations in the QmlJS code model:
See also Evaluate, ValueOwner, and ValueVisitor.
Member Function Documentation
Value::Value()
Default constructs an instance of Value.
[virtual]
Value::~Value()
Destroys the instance of Value. The destructor is virtual.