IncludeJS 0.0.1
Build your own JavaScript runtime
 
Loading...
Searching...
No Matches
engine_context.h
1#ifndef INCLUDEJS_ENGINE_CONTEXT_H_
2#define INCLUDEJS_ENGINE_CONTEXT_H_
3
4#include "engine_export.h"
5
6#include <includejs/engine_promise.h>
7#include <includejs/engine_value.h>
8
9#include <memory> // std::unique_ptr
10#include <string> // std::string
11
12namespace includejs {
13
15class INCLUDEJS_ENGINE_EXPORT Context {
16public:
17 // Consumers are not meant to create this class directly
18#ifndef DOXYGEN
19 Context(const void *context);
20 ~Context();
21#endif
22 auto make_undefined() const -> Value;
23 auto make_error(const std::string &message) const -> Value;
24 auto make_object() const -> Value;
25 auto make_promise() const -> Promise;
26 auto make_array() const -> Value;
27 auto from(const std::string &value) const -> Value;
28 auto from(const char *) const -> Value;
29 auto from(int value) const -> Value;
30 auto from(double value) const -> Value;
31 auto from(bool value) const -> Value;
32 auto from(std::nullptr_t value) const -> Value;
33 auto from_json(const std::string &json_string) const -> Value;
34 auto global() const -> Value;
35
36private:
37 struct Internal;
38 std::unique_ptr<Internal> internal;
39};
40
41} // namespace includejs
42
43#endif
Definition engine_context.h:15
Definition engine_promise.h:13
Definition engine_value.h:30