|
| | var () noexcept |
| | ~var () noexcept |
| | var (const var &valueToCopy) |
| | var (int value) noexcept |
| | var (int64 value) noexcept |
| | var (bool value) noexcept |
| | var (double value) noexcept |
| | var (const char *value) |
| | var (const wchar_t *value) |
| | var (const String &value) |
| | var (const Array< var > &value) |
| | var (const StringArray &value) |
| | var (ReferenceCountedObject *object) |
| | var (NativeFunction method) noexcept |
| | var (const void *binaryData, size_t dataSize) |
| | var (const MemoryBlock &binaryData) |
| var & | operator= (const var &valueToCopy) |
| var & | operator= (int value) |
| var & | operator= (int64 value) |
| var & | operator= (bool value) |
| var & | operator= (double value) |
| var & | operator= (const char *value) |
| var & | operator= (const wchar_t *value) |
| var & | operator= (const String &value) |
| var & | operator= (const MemoryBlock &value) |
| var & | operator= (const Array< var > &value) |
| var & | operator= (ReferenceCountedObject *object) |
| var & | operator= (NativeFunction method) |
| | var (var &&) noexcept |
| | var (String &&) |
| | var (MemoryBlock &&) |
| | var (Array< var > &&) |
| var & | operator= (var &&) noexcept |
| var & | operator= (String &&) |
| void | swapWith (var &other) noexcept |
| | operator int () const noexcept |
| | operator int64 () const noexcept |
| | operator bool () const noexcept |
| | operator float () const noexcept |
| | operator double () const noexcept |
| | operator String () const |
| String | toString () const |
| Array< var > * | getArray () const noexcept |
| MemoryBlock * | getBinaryData () const noexcept |
| ReferenceCountedObject * | getObject () const noexcept |
| DynamicObject * | getDynamicObject () const noexcept |
| bool | isVoid () const noexcept |
| bool | isUndefined () const noexcept |
| bool | isInt () const noexcept |
| bool | isInt64 () const noexcept |
| bool | isBool () const noexcept |
| bool | isDouble () const noexcept |
| bool | isString () const noexcept |
| bool | isObject () const noexcept |
| bool | isArray () const noexcept |
| bool | isBinaryData () const noexcept |
| bool | isMethod () const noexcept |
| bool | equals (const var &other) const noexcept |
| bool | equalsWithSameType (const var &other) const noexcept |
| bool | hasSameTypeAs (const var &other) const noexcept |
| var | clone () const noexcept |
| int | size () const |
| const var & | operator[] (int arrayIndex) const |
| var & | operator[] (int arrayIndex) |
| void | append (const var &valueToAppend) |
| void | insert (int index, const var &value) |
| void | remove (int index) |
| void | resize (int numArrayElementsWanted) |
| int | indexOf (const var &value) const |
| const var & | operator[] (const Identifier &propertyName) const |
| const var & | operator[] (const char *propertyName) const |
| var | getProperty (const Identifier &propertyName, const var &defaultReturnValue) const |
| bool | hasProperty (const Identifier &propertyName) const noexcept |
| var | call (const Identifier &method) const |
| var | call (const Identifier &method, const var &arg1) const |
| var | call (const Identifier &method, const var &arg1, const var &arg2) const |
| var | call (const Identifier &method, const var &arg1, const var &arg2, const var &arg3) |
| var | call (const Identifier &method, const var &arg1, const var &arg2, const var &arg3, const var &arg4) const |
| var | call (const Identifier &method, const var &arg1, const var &arg2, const var &arg3, const var &arg4, const var &arg5) const |
| var | invoke (const Identifier &method, const var *arguments, int numArguments) const |
| NativeFunction | getNativeFunction () const |
| void | writeToStream (OutputStream &output) const |
A variant class, that can be used to hold a range of primitive values.
A var object can hold a range of simple primitive values, strings, or any kind of ReferenceCountedObject. The var class is intended to act like the kind of values used in dynamic scripting languages.
You can save/load var objects either in a small, proprietary binary format using writeToStream()/readFromStream(), or as JSON by using the JSON class.
- See also
- JSON, DynamicObject
@tags{Core}
| bool juce::var::equals |
( |
const var & | other | ) |
const |
|
noexcept |
Returns true if this var has the same value as the one supplied. Note that this ignores the type, so a string var "123" and an integer var with the value 123 are considered to be equal.
Note that equality checking depends on the "wrapped" type of the object on which equals() is called. That means the following code will convert the right-hand-side argument to a string and compare the string values, because the object on the left-hand-side was initialised from a string:
var (
"123").equals (
var (123))
var() noexcept
Definition juce_Variant.cpp:509
However, the following code will convert the right-hand-side argument to a double and compare the values as doubles, because the object on the left-hand-side was initialised from a double:
var (45.6).equals (
"45.6000")
- See also
- equalsWithSameType