Namespace jac
Namespaces
| Type | Name |
|---|---|
| namespace | ProtoBuilder |
| namespace | detail |
Classes
| Type | Name |
|---|---|
| class | ArrayBufferWrapper <managed> A wrapper for JSValue with ArrayBuffer type with RAII. |
| class | ArrayWrapper <managed> A wrapper for JSValue with Array type with RAII. |
| class | Atom A wrapper around JSAtom with RAII. In the context of QuickJS, Atom is used to represent identifiers of properties, variables, functions, etc. |
| class | BasicStreamFeature <class Next> |
| class | Class <class Builder> |
| struct | ComposeMachine <class Base, MFeatures> |
| struct | ComposeMachine< Base > <class Base> |
| struct | ComposeMachine< Base, FirstFeature, MFeatures... > <class Base, FirstFeature, MFeatures> |
| class | ContextRef A wrapper around JSContext* providing some related functionality. |
| struct | ConvTraits <typename T, typename En> |
| struct | ConvTraits< T, std::enable_if_t< std::is_integral_v< T > &&detail::is_leq_i32< T >, T > > <typename T> |
| struct | ConvTraits< bool > <> |
| struct | ConvTraits< std::chrono::milliseconds > <> |
| class | EventLoopFeature <class Next> |
| class | EventLoopTerminal <class Next> |
| class | EventQueueFeature <class Next> |
| class | ExceptionWrapper <managed> An exception wrapper which can either wrap a JSValue or contain an exception description and can be thrown into JS as a specific Error type. |
| class | File |
| struct | FileProtoBuilder |
| class | FilesystemFeature <class Next> |
| class | FunctionFactory Various methods for wrapping C++ functions into javascript functions. |
| class | FunctionWrapper <managed> A wrapper for JSValue with Function type with RAII. |
| class | MachineBase |
| class | Module A wrapper around JSModuleDef that allows for easy exporting of values. |
| class | NodeModuleLoaderFeature <class Next> |
| class | ObjectWrapper <managed> A wrapper for JSValue with Object type with RAII. |
| class | OsWritable |
| class | OwnedString An owning RAII handle for a QuickJS-allocated C string. |
| class | Plugin A base class for all plugins. |
| class | PluginHandle A handle which can be used to retrieve a plugin from a machine. |
| class | PluginHolderFeature <typename Next> An MFeature that allows for inserting plugins into the machine and retrieving them using PluginHandeles. |
| class | PluginManager A class for managing groups of plugins and initializing them all at once. |
| class | PromiseWrapper <managed> A wrapper for JSValue with Promise type with RAII. |
| class | Readable |
| struct | ReadableProtoBuilder |
| class | ReadableRef |
| struct | SgnUnwrap <typename Sgn> |
| struct | SgnUnwrap< Res(Args...)> <typename Res, Args> |
| class | SimpleModuleLoaderFeature <class Next> |
| class | StdioFeature <class Next> |
| class | TimersFeature <class Next> |
| class | ValueVector An owning contiguous sequence of JavaScript values. |
| class | ValueVectorWeak A non-owning view over a contiguous sequence of JavaScript values. |
| class | ValueWrapper <managed> A wrapper around JSValue with RAII. |
| class | Writable |
| struct | WritableProtoBuilder |
| class | WritableRef |
| struct | is_base_of_template <Base, typename Derived> Checks if a type is derived from a template class. |
Public Types
| Type | Name |
|---|---|
| typedef ArrayWrapper< true > | Array |
| typedef ArrayBufferWrapper< true > | ArrayBuffer |
| typedef ArrayBufferWrapper< false > | ArrayBufferWeak |
| typedef ArrayWrapper< false > | ArrayWeak |
| enum int | EvalFlags |
| typedef ExceptionWrapper< true > | Exception |
| typedef ExceptionWrapper< false > | ExceptionWeak |
| typedef FunctionWrapper< true > | Function |
| typedef FunctionWrapper< false > | FunctionWeak |
| typedef ObjectWrapper< true > | Object |
| typedef ObjectWrapper< false > | ObjectWeak |
| typedef PromiseWrapper< true > | Promise |
| typedef PromiseWrapper< false > | PromiseWeak |
| enum int | PropFlags Flags to specify property access attributes. |
| typedef ValueWrapper< true > | Value |
| typedef ValueWrapper< false > | ValueWeak |
| typedef typename is_base_of_template< Base, Derived >::type | is_base_of_template_t |
Public Attributes
| Type | Name |
|---|---|
| constexpr bool | is_base_of_template_v = [**is\_base\_of\_template**](structjac_1_1is__base__of__template.md)<Base, Derived>::value |
Public Functions
| Type | Name |
|---|---|
| SgnUnwrap (Res(Class::*)(Args...)) |
|
| std::tuple< Args... > | convertArgs (ContextRef ctx, ValueVectorWeak argv, std::index_sequence< Is... >) |
| JSModuleDef * | createJsonModule (JSContext * ctx, const char * name, JSValue val) Create a synthetic module whose only export is a default holding the given value. |
| T | fromValue (ContextRef ctx, ValueWeak val) |
| int | moduleAttributesJsonType (JSContext * ctx, JSValueConst attributes) Determine whether import attributes request a JSON module. |
| constexpr EvalFlags | operator& (EvalFlags a, EvalFlags b) |
| constexpr PropFlags | operator& (PropFlags a, PropFlags b) |
| constexpr EvalFlags | operator| (EvalFlags a, EvalFlags b) |
| constexpr PropFlags | operator| (PropFlags a, PropFlags b) |
| Value | processCall (ContextRef ctx, ValueWeak, ValueVectorWeak argv, Func & f) |
| JSValue | processCallRaw (ContextRef ctx, JSValueConst thisVal, int argc, JSValueConst * argv, Func & f) |
| Value | processCallThis (ContextRef ctx, ValueWeak thisVal, ValueVectorWeak argv, Func & f) |
| Value | processCallThisVariadic (ContextRef ctx, ValueWeak thisVal, ValueVectorWeak argv, Func & f) |
| Value | processCallVariadic (ContextRef ctx, ValueWeak, ValueVectorWeak argv, Func & f) |
| JSValue | processCallVariadicRaw (ContextRef ctx, JSValueConst thisVal, int argc, JSValueConst * argv, Func & f) |
| JSValue | propagateExceptions (ContextRef ctx, Func & f) noexcept |
| JSValue | propagateExceptions (ContextRef ctx, Func && f) noexcept |
| constexpr bool | static_false () |
| bool | strContains (const auto & str, const auto & substr) |
| std::string_view | substring (const std::string & str, size_t pos, size_t count=std::string::npos) |
| Value | toValue (ContextRef ctx, T val) |
Public Static Functions
| Type | Name |
|---|---|
| int | checkModuleAttributes (JSContext * ctx, void *, JSValueConst attributes) Import-attribute check callback for JS_SetModuleLoaderFunc2. |
| void | initializeIo (Machine & machine) |
Public Types Documentation
typedef Array
typedef ArrayBuffer
typedef ArrayBufferWeak
typedef ArrayWeak
enum EvalFlags
enum jac::EvalFlags {
Global = JS_EVAL_TYPE_GLOBAL,
Module = JS_EVAL_TYPE_MODULE,
Strict = JS_EVAL_FLAG_STRICT,
CompileOnly = JS_EVAL_FLAG_COMPILE_ONLY,
BacktraceBarrier = JS_EVAL_FLAG_BACKTRACE_BARRIER
};
typedef Exception
typedef ExceptionWeak
typedef Function
typedef FunctionWeak
typedef Object
typedef ObjectWeak
typedef Promise
typedef PromiseWeak
enum PropFlags
Flags to specify property access attributes.
enum jac::PropFlags {
Default = 0,
Configurable = JS_PROP_CONFIGURABLE,
Writable = JS_PROP_WRITABLE,
Enumerable = JS_PROP_ENUMERABLE,
C_W_E = JS_PROP_C_W_E
};
typedef Value
typedef ValueWeak
typedef is_base_of_template_t
Public Attributes Documentation
variable is_base_of_template_v
Public Functions Documentation
function SgnUnwrap
function convertArgs
template<typename... Args, std::size_t... Is>
inline std::tuple< Args... > jac::convertArgs (
ContextRef ctx,
ValueVectorWeak argv,
std::index_sequence< Is... >
)
function createJsonModule
Create a synthetic module whose only export is a default holding the given value.
Takes ownership of val (it is freed on failure and otherwise attached to the module as its private value until instantiation).
Returns:
The created module, or nullptr on error (with a pending exception)
function fromValue
function moduleAttributesJsonType
Determine whether import attributes request a JSON module.
Returns:
0 = not JSON, 1 = "json", 2 = "json5"
function operator&
function operator&
function operator|
function operator|
function processCall
template<typename Func, typename Res, typename... Args>
inline Value jac::processCall (
ContextRef ctx,
ValueWeak,
ValueVectorWeak argv,
Func & f
)
function processCallRaw
template<typename Func, typename Res, typename... Args>
inline JSValue jac::processCallRaw (
ContextRef ctx,
JSValueConst thisVal,
int argc,
JSValueConst * argv,
Func & f
)
function processCallThis
template<typename Func, typename Res, typename... Args>
inline Value jac::processCallThis (
ContextRef ctx,
ValueWeak thisVal,
ValueVectorWeak argv,
Func & f
)
function processCallThisVariadic
template<typename Func, typename Res>
inline Value jac::processCallThisVariadic (
ContextRef ctx,
ValueWeak thisVal,
ValueVectorWeak argv,
Func & f
)
function processCallVariadic
template<typename Func, typename Res>
inline Value jac::processCallVariadic (
ContextRef ctx,
ValueWeak,
ValueVectorWeak argv,
Func & f
)
function processCallVariadicRaw
template<typename Func, typename Res>
inline JSValue jac::processCallVariadicRaw (
ContextRef ctx,
JSValueConst thisVal,
int argc,
JSValueConst * argv,
Func & f
)
function propagateExceptions
template<typename Func>
inline JSValue jac::propagateExceptions (
ContextRef ctx,
Func & f
) noexcept
Various functions to process function calls with unprocessed javascript arguments. Arguments and return value of the functions are automatically converted to and from javascript values. Exceptions thrown within the functions are caught and propagated to the javascript side.
function propagateExceptions
template<typename Func>
inline JSValue jac::propagateExceptions (
ContextRef ctx,
Func && f
) noexcept
function static_false
function strContains
function substring
std::string_view jac::substring (
const std::string & str,
size_t pos,
size_t count=std::string::npos
)
function toValue
Public Static Functions Documentation
function checkModuleAttributes
Import-attribute check callback for JS_SetModuleLoaderFunc2.
Only the "type" attribute is supported; any other attribute key is rejected with a TypeError, as required by the specification.
Returns:
0 if the attributes are supported, -1 on error (with a pending exception)
function initializeIo
The documentation for this class was generated from the following file src/jac/features/basicStreamFeature.h