56 const var& thisObject;
61 using NativeFunction = std::function<var(const NativeFunctionArgs&)>;
70 var (
const var& valueToCopy);
71 var (
int value) noexcept;
72 var (int64 value) noexcept;
73 var (
bool value) noexcept;
74 var (
double value) noexcept;
75 var (
const char* value);
76 var (
const wchar_t* value);
81 var (NativeFunction method) noexcept;
82 var (
const void* binaryData,
size_t dataSize);
85 var& operator= (
const var& valueToCopy);
86 var& operator= (
int value);
87 var& operator= (int64 value);
88 var& operator= (
bool value);
89 var& operator= (
double value);
90 var& operator= (
const char* value);
91 var& operator= (
const wchar_t* value);
96 var& operator= (NativeFunction method);
102 var& operator= (
var&&) noexcept;
105 void swapWith (
var& other) noexcept;
108 static var undefined() noexcept;
111 operator int()
const noexcept;
112 operator int64()
const noexcept;
113 operator bool()
const noexcept;
114 operator float()
const noexcept;
115 operator double()
const noexcept;
139 bool isVoid()
const noexcept;
140 bool isUndefined()
const noexcept;
141 bool isInt()
const noexcept;
142 bool isInt64()
const noexcept;
143 bool isBool()
const noexcept;
144 bool isDouble()
const noexcept;
145 bool isString()
const noexcept;
146 bool isObject()
const noexcept;
147 bool isArray()
const noexcept;
148 bool isBinaryData()
const noexcept;
149 bool isMethod()
const noexcept;
156 bool equals (
const var& other)
const noexcept;
162 bool equalsWithSameType (
const var& other)
const noexcept;
165 bool hasSameTypeAs (
const var& other)
const noexcept;
171 var clone()
const noexcept;
186 const var& operator[] (
int arrayIndex)
const;
195 var& operator[] (
int arrayIndex);
204 void append (
const var& valueToAppend);
213 void insert (
int index,
const var& value);
220 void remove (
int index);
228 void resize (
int numArrayElementsWanted);
234 int indexOf (
const var& value)
const;
238 const var& operator[] (
const Identifier& propertyName)
const;
240 const var& operator[] (
const char* propertyName)
const;
243 var getProperty (
const Identifier& propertyName,
const var& defaultReturnValue)
const;
245 bool hasProperty (
const Identifier& propertyName)
const noexcept;
260 var invoke (
const Identifier& method,
const var* arguments,
int numArguments)
const;
262 NativeFunction getNativeFunction()
const;
286 JUCE_DEPRECATED_STATIC (
static const var null;)
309 char stringValue[
sizeof (
String)];
312 NativeFunction* methodValue;
315 friend bool canCompare (
const var&,
const var&);
326 var (
const void*) =
delete;
327 var& operator= (
const void*) =
delete;
345 JUCE_API bool operator== (
const var&,
const char*);
346 JUCE_API bool operator!= (
const var&,
const char*);
353 template <
typename Type>
356 static Type fromVar (
const var& v) {
return static_cast<Type
> (v); }
357 static var toVar (
const Type& t) {
return t; }
364 static String fromVar (
const var& v) {
return v.toString(); }
365 static var toVar (
const String& s) {
return s; }
#define JUCE_API
This macro is added to all JUCE public class declarations.
Represents a string identifier, designed for accessing properties by name.
A variant class, that can be used to hold a range of primitive values.
A special array for holding a list of strings.
Represents a dynamically implemented object.
The base class for streams that write data to some kind of destination.
Holds a resizable array of primitive or copy-by-value objects.
This structure is passed to a NativeFunction callback, and contains invocation details about the func...
A base class which provides methods for reference-counting.
A class to hold a resizable block of raw data.
This template-overloaded class can be used to convert between var and custom types.