-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2015 Jay Freeman (saurik)
+/* Cycript - The Truly Universal Scripting Language
+ * Copyright (C) 2009-2016 Jay Freeman (saurik)
*/
/* GNU Affero General Public License, Version 3 {{{ */
#include "String.hpp"
extern JSStringRef Array_s;
+extern JSStringRef constructor_s;
extern JSStringRef cy_s;
extern JSStringRef cyi_s;
extern JSStringRef cyt_s;
extern "C" void CYSetupContext(JSGlobalContextRef context);
const char *CYExecute(JSContextRef context, CYPool &pool, CYUTF8String code);
+
+#ifndef __ANDROID__
void CYCancel();
+#endif
void CYSetArgs(int argc, const char *argv[]);
void CYArrayPush(JSContextRef context, JSObjectRef array, size_t length, const JSValueRef arguments[]);
void CYArrayPush(JSContextRef context, JSObjectRef array, JSValueRef value);
+bool CYGetOffset(CYPool &pool, JSContextRef context, JSStringRef value, ssize_t &index);
+
const char *CYPoolCString(CYPool &pool, JSContextRef context, JSValueRef value);
JSStringRef CYCopyJSString(const char *value);
}
public:
+ CYJSString() :
+ string_(NULL)
+ {
+ }
+
CYJSString(const CYJSString &rhs) :
string_(CYCopyJSString(rhs.string_))
{
return *this;
}
+ CYJSString &operator =(CYJSString &&rhs) {
+ std::swap(string_, rhs.string_);
+ return *this;
+ }
+
~CYJSString() {
Clear_();
}