Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Conversions.h File Reference
#include "lib/code_generation.h"
#include "lib/debug.h"
#include "ps/CStr.h"
#include "scriptinterface/Exceptions.h"
#include "scriptinterface/Request.h"
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <js/experimental/TypedData.h>
#include <limits>
#include <optional>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for Conversions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Script
 Abstraction around a SpiderMonkey JSContext.
 

Macros

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

Functions

template<typename T >
bool Script::FromJSVal (const Request &rq, const JS::HandleValue val, T &ret)
 Convert a JS::Value to a C++ type. More...
 
template<typename T >
bool Script::FromJSVal (const Request &rq, JS::HandleValue v, std::optional< T > &out)
 
template<typename T >
void Script::ToJSVal (const Request &rq, JS::MutableHandleValue ret, T const &val)
 Convert a C++ type to a JS::Value. More...
 
template<std::size_t N>
void Script::ToJSVal (const Request &rq, JS::MutableHandleValue ret, const char(&val)[N])
 
template<std::size_t N>
void Script::ToJSVal (const Request &rq, JS::MutableHandleValue ret, const wchar_t(&val)[N])
 
template<>
void Script::ToJSVal< JS::PersistentRootedValue > (const Request &, JS::MutableHandleValue handle, const JS::PersistentRootedValue &a)
 
template<>
void Script::ToJSVal< JS::Heap< JS::Value > > (const Request &, JS::MutableHandleValue handle, const JS::Heap< JS::Value > &a)
 
template<>
void Script::ToJSVal< JS::RootedValue > (const Request &, JS::MutableHandleValue handle, const JS::RootedValue &a)
 
template<>
void Script::ToJSVal< JS::HandleValue > (const Request &, JS::MutableHandleValue handle, const JS::HandleValue &a)
 
template<typename T >
bool Script::FromJSProperty (const Request &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 Request &rq, JS::MutableHandleValue ret, const std::vector< T > &val)
 
template<typename T >
bool Script::FromJSVal_vector (const Request &rq, JS::HandleValue v, std::vector< T > &out)
 

Macro Definition Documentation

◆ FAIL

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

◆ JSVAL_VECTOR

#define JSVAL_VECTOR (   T)
Value:
namespace Script { \
template<> void ToJSVal<std::vector<T> >(const Request& rq, JS::MutableHandleValue ret, const std::vector<T>& val) \
{ \
ToJSVal_vector(rq, ret, val); \
} \
template<> bool FromJSVal<std::vector<T> >(const Request& rq, JS::HandleValue v, std::vector<T>& out) \
{ \
return FromJSVal_vector(rq, v, out); \
} \
}
Abstraction around a SpiderMonkey JSContext.
Definition: DapInterface.h:32
bool FromJSVal_vector(const Request &rq, JS::HandleValue v, std::vector< T > &out)
Definition: Conversions.h:154
static void out(const wchar_t *fmt,...)
Definition: wdbg_sym.cpp:407