IncludeJS  0.0.1
Build your own JavaScript runtime
includejs::Value Class Reference

Public Types

using Function = std::function< Value(std::vector< Value > arguments)>
 
using FunctionStorage = std::map< void *, Function >
 

Public Member Functions

 Value (Value &&other) noexcept
 
 Value (const Value &other)=delete
 
auto is_number () const -> bool
 
auto is_string () const -> bool
 
auto is_error () const -> bool
 
auto is_object () const -> bool
 
auto is_boolean () const -> bool
 
auto is_undefined () const -> bool
 
auto is_null () const -> bool
 
auto is_array () const -> bool
 
auto is_function () const -> bool
 
auto to_number () const -> double
 
auto to_string () const -> std::string
 
auto to_boolean () const -> bool
 
auto to_function () const -> Function
 
auto type () const -> ValueType
 
auto at (const std::string &property) const -> std::optional< Value >
 
auto at (const unsigned int &position) const -> std::optional< Value >
 
auto set (const std::string &property, Value value) -> void
 
auto set (const std::string &property, Function function) -> void
 
auto private_data () -> void *
 
auto private_data (void *data, std::function< void(void *)> deleter) -> void
 
auto push (Value value) -> void
 
auto to_map () const -> std::map< std::string, Value >
 
auto to_vector () const -> std::vector< Value >
 
auto to_json_string () const -> std::string
 

The documentation for this class was generated from the following file: