#include "precompiled.h"#include "ScriptInterface.h"#include "graphics/Entity.h"#include "ps/utf16string.h"#include "ps/CLogger.h"#include "ps/CStr.h"#include "scriptinterface/ScriptExtraHeaders.h"#include "scriptinterface/ScriptTypes.h"#include "js/jstypedarray.h"#include "js/jsdbgapi.h"Defines | |
| #define | FAIL(msg) STMT(JS_ReportError(cx, msg); return false) |
| #define | WARN_IF_NOT(c, v) STMT(if (!(c)) { JS_ReportWarning(cx, "Script value conversion check failed: %s (got type %s)", #c, JS_GetTypeName(cx, JS_TypeOfValue(cx, v))); }) |
| #define | VECTOR(T) |
Functions | |
| template<> | |
| bool | ScriptInterface::FromJSVal< std::wstring > (JSContext *cx, jsval v, std::wstring &out) |
| template<> | |
| bool | ScriptInterface::FromJSVal< std::string > (JSContext *cx, jsval v, std::string &out) |
| template<> | |
| jsval | ScriptInterface::ToJSVal< std::wstring > (JSContext *cx, const std::wstring &val) |
| template<> | |
| jsval | ScriptInterface::ToJSVal< std::string > (JSContext *cx, const std::string &val) |
| template<typename T > | |
| static jsval | ToJSVal_vector (JSContext *cx, const std::vector< T > &val) |
| template<typename T > | |
| static bool | FromJSVal_vector (JSContext *cx, jsval v, std::vector< T > &out) |
| template<> | |
| jsval | ScriptInterface::ToJSVal< std::vector< IComponent * > > (JSContext *cx, const std::vector< IComponent * > &val) |
| template<> | |
| bool | ScriptInterface::FromJSVal< std::vector< Entity > > (JSContext *cx, jsval v, std::vector< Entity > &out) |
| #define FAIL | ( | msg | ) | STMT(JS_ReportError(cx, msg); return false) |
| #define VECTOR | ( | T | ) |
template<> jsval ScriptInterface::ToJSVal<std::vector<T> >(JSContext* cx, const std::vector<T>& val) \ { \ return ToJSVal_vector(cx, val); \ } \ template<> bool ScriptInterface::FromJSVal<std::vector<T> >(JSContext* cx, jsval v, std::vector<T>& out) \ { \ return FromJSVal_vector(cx, v, out); \ }
| #define WARN_IF_NOT | ( | c, | |||
| v | ) | STMT(if (!(c)) { JS_ReportWarning(cx, "Script value conversion check failed: %s (got type %s)", #c, JS_GetTypeName(cx, JS_TypeOfValue(cx, v))); }) |
| static bool FromJSVal_vector | ( | JSContext * | cx, | |
| jsval | v, | |||
| std::vector< T > & | out | |||
| ) | [inline, static] |
| bool ScriptInterface::FromJSVal< std::string > | ( | JSContext * | cx, | |
| jsval | v, | |||
| std::string & | out | |||
| ) | [inline] |
| bool ScriptInterface::FromJSVal< std::vector< Entity > > | ( | JSContext * | cx, | |
| jsval | v, | |||
| std::vector< Entity > & | out | |||
| ) | [inline] |
| bool ScriptInterface::FromJSVal< std::wstring > | ( | JSContext * | cx, | |
| jsval | v, | |||
| std::wstring & | out | |||
| ) | [inline] |
| jsval ScriptInterface::ToJSVal< std::string > | ( | JSContext * | cx, | |
| const std::string & | val | |||
| ) | [inline] |
| jsval ScriptInterface::ToJSVal< std::vector< IComponent * > > | ( | JSContext * | cx, | |
| const std::vector< IComponent * > & | val | |||
| ) | [inline] |
| jsval ScriptInterface::ToJSVal< std::wstring > | ( | JSContext * | cx, | |
| const std::wstring & | val | |||
| ) | [inline] |
| static jsval ToJSVal_vector | ( | JSContext * | cx, | |
| const std::vector< T > & | val | |||
| ) | [inline, static] |
1.6.3