irccd
3.0.3
|
Miscellaneous Duktape extras. More...
Classes | |
class | stack_guard |
Stack sanity checker. More... | |
class | context |
RAII based Duktape handler. More... | |
class | stack_info |
Error description. More... | |
struct | type_traits |
Operations on different types. More... | |
class | error |
Base ECMAScript error class. More... | |
class | eval_error |
Error in eval() function. More... | |
class | range_error |
Value is out of range. More... | |
class | reference_error |
Trying to use a variable that does not exist. More... | |
class | syntax_error |
Syntax error in the script. More... | |
class | type_error |
Invalid type given. More... | |
class | uri_error |
URI manipulation failure. More... | |
struct | type_traits< std::exception > |
Specialization for std::exception. More... | |
struct | type_traits< error > |
Specialization for error. More... | |
struct | type_traits< bool > |
Specialization for bool. More... | |
struct | type_traits< duk_double_t > |
Specialization for duk_double_t. More... | |
struct | type_traits< duk_int_t > |
Specialization for duk_int_t. More... | |
struct | type_traits< duk_uint_t > |
Specialization for duk_uint_t. More... | |
struct | type_traits< const char * > |
Specialization for C strings. More... | |
struct | type_traits< std::string > |
Specialization for C++ std::strings. More... | |
struct | type_traits< std::string_view > |
Specialization for C++ std::string_views. More... | |
struct | type_traits< std::vector< T > > |
Specialization for std::vector<T> More... | |
struct | type_traits< std::shared_ptr< file > > |
Specialization for generic file type as shared_ptr. More... | |
struct | type_traits< daemon::bot > |
Specialize dukx_type_traits for bot. More... | |
struct | type_traits< std::system_error > |
Specialize dukx_type_traits for boost::system::system_error. More... | |
struct | type_traits< boost::system::system_error > |
Specialize dukx_type_traits for boost::system::system_error. More... | |
struct | type_traits< daemon::whois_info > |
Specialization for type_traits<whois_info> More... | |
struct | type_traits< plugin > |
Specialize dukx_type_traits for plugin. More... | |
struct | type_traits< daemon::plugin_error > |
Specialization for plugin_error. More... | |
struct | type_traits< std::shared_ptr< daemon::server > > |
Specialization for servers as shared_ptr. More... | |
struct | type_traits< daemon::server_error > |
Specialization for server_error. More... | |
Functions | |
template<typename T > | |
auto | push (duk_context *ctx, T &&value) -> int |
template<typename T > | |
auto | get (duk_context *ctx, duk_idx_t index) |
template<typename T > | |
auto | require (duk_context *ctx, duk_idx_t index) |
template<typename Error > | |
void | raise (duk_context *ctx, Error &&error) |
auto | get_stack (duk_context *ctx, int index, bool pop=true) -> stack_info |
Miscellaneous Duktape extras.
auto irccd::js::duk::get | ( | duk_context * | ctx, |
duk_idx_t | index | ||
) |
Generic get function.
This functions calls type_traits<T>::get if specialized.
ctx | the Duktape context |
index | the value index |
auto irccd::js::duk::get_stack | ( | duk_context * | ctx, |
int | index, | ||
bool | pop = true |
||
) | -> stack_info |
Get the error object when a JavaScript error has been thrown (e.g. eval failure).
ctx | the context |
index | the index |
pop | if true, also remove the exception from the stack |
auto irccd::js::duk::push | ( | duk_context * | ctx, |
T && | value | ||
) | -> int |
Generic push function.
This function calls type_traits<T>::push if specialized.
ctx | the Duktape context |
value | the forwarded value |
void irccd::js::duk::raise | ( | duk_context * | ctx, |
Error && | error | ||
) |
Create an exception into the stack and throws it.
This function needs the following requirements in type_traits
Error can be any kind of value, it is forwarded.
ctx | the Duktape context |
error | the error object |
auto irccd::js::duk::require | ( | duk_context * | ctx, |
duk_idx_t | index | ||
) |
Generic require function.
This functions calls type_traits<T>::require if specialized.
ctx | the Duktape context |
index | the value index |