Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
JSInterface_Hotkey.cpp File Reference
#include "precompiled.h"
#include "JSInterface_Hotkey.h"
#include "lib/external_libraries/libsdl.h"
#include "ps/CLogger.h"
#include "ps/ConfigDB.h"
#include "ps/Hotkey.h"
#include "ps/KeyName.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptConversions.h"
#include <unordered_map>
#include <vector>
#include <set>
Include dependency graph for JSInterface_Hotkey.cpp:

Namespaces

namespace  anonymous_namespace{JSInterface_Hotkey.cpp}
 

Functions

template<typename T , typename U >
static void ToJSVal_unordered_map (const ScriptRequest &rq, JS::MutableHandleValue ret, const std::unordered_map< T, U > &val)
 Convert an unordered map to a JS object, mapping keys to values. More...
 
template<>
void Script::ToJSVal< std::unordered_map< std::string, std::vector< std::vector< std::string > > > > (const ScriptRequest &rq, JS::MutableHandleValue ret, const std::unordered_map< std::string, std::vector< std::vector< std::string > > > &val)
 
template<>
void Script::ToJSVal< std::unordered_map< std::string, std::string > > (const ScriptRequest &rq, JS::MutableHandleValue ret, const std::unordered_map< std::string, std::string > &val)
 
JS::Value anonymous_namespace{JSInterface_Hotkey.cpp}::GetHotkeyMap (const ScriptRequest &rq)
 
JS::Value anonymous_namespace{JSInterface_Hotkey.cpp}::GetScancodeKeyNames (const ScriptRequest &rq)
 
void anonymous_namespace{JSInterface_Hotkey.cpp}::ReloadHotkeys ()
 
JS::Value anonymous_namespace{JSInterface_Hotkey.cpp}::GetConflicts (const ScriptRequest &rq, JS::HandleValue combination)
 

Function Documentation

◆ Script::ToJSVal< std::unordered_map< std::string, std::string > >()

template<>
void Script::ToJSVal< std::unordered_map< std::string, std::string > > ( const ScriptRequest rq,
JS::MutableHandleValue  ret,
const std::unordered_map< std::string, std::string > &  val 
)

◆ Script::ToJSVal< std::unordered_map< std::string, std::vector< std::vector< std::string > > > >()

template<>
void Script::ToJSVal< std::unordered_map< std::string, std::vector< std::vector< std::string > > > > ( const ScriptRequest rq,
JS::MutableHandleValue  ret,
const std::unordered_map< std::string, std::vector< std::vector< std::string > > > &  val 
)

◆ ToJSVal_unordered_map()

template<typename T , typename U >
static void ToJSVal_unordered_map ( const ScriptRequest rq,
JS::MutableHandleValue  ret,
const std::unordered_map< T, U > &  val 
)
static

Convert an unordered map to a JS object, mapping keys to values.

Assumes T to have a c_str() method that returns a const char* NB: this is unordered since no particular effort is made to preserve order. TODO: this could be moved to ScriptConversions.cpp if the need arises.