#include "Pooling.hpp"
#include "String.hpp"
+#include "Utility.hpp"
extern JSStringRef Array_s;
extern JSStringRef constructor_s;
extern JSStringRef cy_s;
extern JSStringRef cyi_s;
extern JSStringRef cyt_s;
+extern JSStringRef cyt__s;
extern JSStringRef length_s;
extern JSStringRef message_s;
extern JSStringRef name_s;
void CYCancel();
#endif
-void CYSetArgs(int argc, const char *argv[]);
+void CYSetArgs(const char *argv0, const char *script, int argc, const char *argv[]);
bool CYCastBool(JSContextRef context, JSValueRef value);
double CYCastDouble(JSContextRef context, JSValueRef value);
JSValueRef CYJSUndefined(JSContextRef context);
JSValueRef CYJSNull(JSContextRef context);
+void *CYCastPointerEx_(JSContextRef context, JSObjectRef value);
+
+template <typename Type_>
+_finline Type_ CYCastPointerEx(JSContextRef context, JSObjectRef value) {
+ return reinterpret_cast<Type_>(CYCastPointerEx_(context, value));
+}
+
void *CYCastPointer_(JSContextRef context, JSValueRef value, bool *guess = NULL);
template <typename Type_>
{
}
- template <typename Arg0_>
- CYJSString(Arg0_ arg0) :
- string_(CYCopyJSString(arg0))
- {
- }
-
- template <typename Arg0_, typename Arg1_>
- CYJSString(Arg0_ arg0, Arg1_ arg1) :
- string_(CYCopyJSString(arg0, arg1))
+ template <typename ...Args_>
+ CYJSString(Args_ &&... args) :
+ string_(CYCopyJSString(cy::Forward<Args_>(args)...))
{
}