Pyrogenesis  trunk
Macros | Functions
ScriptConversions.cpp File Reference
#include "precompiled.h"
#include "ScriptConversions.h"
#include "graphics/Entity.h"
#include "maths/Vector2D.h"
#include "ps/utf16string.h"
#include "ps/CStr.h"
Include dependency graph for ScriptConversions.cpp:

Macros

#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, InformalValueTypeName(v)); })
 

Functions

static const char * InformalValueTypeName (const JS::Value &v)
 
template<>
bool ScriptInterface::FromJSVal< std::wstring > (JSContext *cx, JS::HandleValue v, std::wstring &out)
 
template<>
bool ScriptInterface::FromJSVal< std::string > (JSContext *cx, JS::HandleValue v, std::string &out)
 
template<>
void ScriptInterface::ToJSVal< std::wstring > (JSContext *cx, JS::MutableHandleValue ret, const std::wstring &val)
 
template<>
void ScriptInterface::ToJSVal< std::string > (JSContext *cx, JS::MutableHandleValue ret, const std::string &val)
 
template<>
void ScriptInterface::ToJSVal< std::vector< IComponent * > > (JSContext *cx, JS::MutableHandleValue ret, const std::vector< IComponent * > &val)
 
template<>
bool ScriptInterface::FromJSVal< std::vector< Entity > > (JSContext *cx, JS::HandleValue v, std::vector< Entity > &out)
 

Macro Definition Documentation

#define FAIL (   msg)    STMT(JS_ReportError(cx, msg); return false)
#define WARN_IF_NOT (   c,
 
)    STMT(if (!(c)) { JS_ReportWarning(cx, "Script value conversion check failed: %s (got type %s)", #c, InformalValueTypeName(v)); })

Function Documentation

static const char* InformalValueTypeName ( const JS::Value &  v)
static
template<>
bool ScriptInterface::FromJSVal< std::string > ( JSContext *  cx,
JS::HandleValue  v,
std::string &  out 
)
template<>
bool ScriptInterface::FromJSVal< std::vector< Entity > > ( JSContext *  cx,
JS::HandleValue  v,
std::vector< Entity > &  out 
)
template<>
bool ScriptInterface::FromJSVal< std::wstring > ( JSContext *  cx,
JS::HandleValue  v,
std::wstring &  out 
)
template<>
void ScriptInterface::ToJSVal< std::string > ( JSContext *  cx,
JS::MutableHandleValue  ret,
const std::string &  val 
)
template<>
void ScriptInterface::ToJSVal< std::vector< IComponent * > > ( JSContext *  cx,
JS::MutableHandleValue  ret,
const std::vector< IComponent * > &  val 
)
template<>
void ScriptInterface::ToJSVal< std::wstring > ( JSContext *  cx,
JS::MutableHandleValue  ret,
const std::wstring &  val 
)