59 const var& thisObject;
64 using NativeFunction = std::function<var (const NativeFunctionArgs&)>;
73 var (
const var& valueToCopy);
74 var (
int value) noexcept;
75 var (int64 value) noexcept;
76 var (
bool value) noexcept;
77 var (
double value) noexcept;
78 var (
const char* value);
79 var (
const wchar_t* value);
84 var (NativeFunction method) noexcept;
85 var (
const void* binaryData,
size_t dataSize);
88 var& operator= (
const var& valueToCopy);
89 var& operator= (
int value);
90 var& operator= (int64 value);
91 var& operator= (
bool value);
92 var& operator= (
double value);
93 var& operator= (
const char* value);
94 var& operator= (
const wchar_t* value);
99 var& operator= (NativeFunction method);
105 var& operator= (
var&&) noexcept;
108 void swapWith (
var& other) noexcept;
111 static var undefined() noexcept;
114 operator int()
const noexcept;
115 operator int64()
const noexcept;
116 operator bool()
const noexcept;
117 operator float()
const noexcept;
118 operator double()
const noexcept;
142 bool isVoid()
const noexcept;
143 bool isUndefined()
const noexcept;
144 bool isInt()
const noexcept;
145 bool isInt64()
const noexcept;
146 bool isBool()
const noexcept;
147 bool isDouble()
const noexcept;
148 bool isString()
const noexcept;
149 bool isObject()
const noexcept;
150 bool isArray()
const noexcept;
151 bool isBinaryData()
const noexcept;
152 bool isMethod()
const noexcept;
159 bool equals (
const var& other)
const noexcept;
165 bool equalsWithSameType (
const var& other)
const noexcept;
168 bool hasSameTypeAs (
const var& other)
const noexcept;
174 var clone()
const noexcept;
189 const var& operator[] (
int arrayIndex)
const;
198 var& operator[] (
int arrayIndex);
207 void append (
const var& valueToAppend);
216 void insert (
int index,
const var& value);
223 void remove (
int index);
231 void resize (
int numArrayElementsWanted);
237 int indexOf (
const var& value)
const;
241 const var& operator[] (
const Identifier& propertyName)
const;
243 const var& operator[] (
const char* propertyName)
const;
246 var getProperty (
const Identifier& propertyName,
const var& defaultReturnValue)
const;
248 bool hasProperty (
const Identifier& propertyName)
const noexcept;
263 var invoke (
const Identifier& method,
const var* arguments,
int numArguments)
const;
265 NativeFunction getNativeFunction()
const;
289 JUCE_DEPRECATED_STATIC (
static const var null;)
312 char stringValue [
sizeof (
String)];
315 NativeFunction* methodValue;
318 friend bool canCompare (
const var&,
const var&);
346 JUCE_API bool operator== (
const var&,
const char*);
347 JUCE_API bool operator!= (
const var&,
const char*);
354 template <
typename Type>
357 static Type fromVar (
const var& v) {
return static_cast<Type
> (v); }
358 static var toVar (
const Type& t) {
return t; }
365 static String fromVar (
const var& v) {
return v.toString(); }
366 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.