Pyrogenesis  trunk
Namespaces | Macros | Functions
ScriptConversions.h File Reference
#include "ScriptRequest.h"
#include "ScriptExceptions.h"
#include "ScriptExtraHeaders.h"
#include <limits>
#include <vector>
Include dependency graph for ScriptConversions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Script
 Wraps SM APIs for manipulating JS objects.
 

Macros

#define FAIL(msg)   STMT(ScriptException::Raise(rq, msg); return false)
 
#define JSVAL_VECTOR(T)
 

Functions

template<typename T >
bool Script::FromJSVal (const ScriptRequest &rq, const JS::HandleValue val, T &ret)
 Convert a JS::Value to a C++ type. More...
 
template<typename T >
void Script::ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue ret, T const &val)
 Convert a C++ type to a JS::Value. More...
 
template<>
void Script::ToJSVal< JS::PersistentRootedValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::PersistentRootedValue &a)
 
template<>
void Script::ToJSVal< JS::Heap< JS::Value > > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::Heap< JS::Value > &a)
 
template<>
void Script::ToJSVal< JS::RootedValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::RootedValue &a)
 
template<>
void Script::ToJSVal< JS::HandleValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::HandleValue &a)
 
template<typename T >
bool Script::FromJSProperty (const ScriptRequest &rq, const JS::HandleValue val, const char *name, T &ret, bool strict=false)
 Convert a named property of an object to a C++ type. More...
 
template<typename T >
void Script::ToJSVal_vector (const ScriptRequest &rq, JS::MutableHandleValue ret, const std::vector< T > &val)
 
template<typename T >
bool Script::FromJSVal_vector (const ScriptRequest &rq, JS::HandleValue v, std::vector< T > &out)
 

Macro Definition Documentation

◆ FAIL

#define FAIL (   msg)    STMT(ScriptException::Raise(rq, msg); return false)

◆ JSVAL_VECTOR

#define JSVAL_VECTOR (   T)
Value:
template<> void Script::ToJSVal<std::vector<T> >(const ScriptRequest& rq, JS::MutableHandleValue ret, const std::vector<T>& val) \
{ \
ToJSVal_vector(rq, ret, val); \
} \
template<> bool Script::FromJSVal<std::vector<T> >(const ScriptRequest& rq, JS::HandleValue v, std::vector<T>& out) \
{ \
return FromJSVal_vector(rq, v, out); \
}
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:421
bool FromJSVal_vector(const ScriptRequest &rq, JS::HandleValue v, std::vector< T > &out)
Definition: ScriptConversions.h:113
Spidermonkey maintains some &#39;local&#39; state via the JSContext* object.
Definition: ScriptRequest.h:59