v8toolkit  0.0.1
Utility library for embedding V8 Javascript engine in a c++ program
Namespaces | Typedefs | Functions | Variables
v8toolkit.cpp File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include <vector>
#include <iostream>
#include <utility>
#include <string>
#include <sstream>
#include <regex>
#include <mutex>
#include <set>
#include <map>
#include <fmt/format.h>
#include <boost/format.hpp>
#include "v8_class_wrapper.h"
#include "./v8toolkit.h"
Include dependency graph for v8toolkit.cpp:

Go to the source code of this file.

Namespaces

 v8toolkit
 

Typedefs

typedef std::map< std::string, RequireResult > v8toolkit::cached_isolate_modules_t
 

Functions

void * operator new[] (size_t size, const char *pName, int flags, unsigned debugFlags, const char *file, int line)
 
void * operator new[] (size_t size, size_t alignment, size_t alignmentOffset, const char *pName, int flags, unsigned debugFlags, const char *file, int line)
 
void v8toolkit::process_v8_flags (int &argc, char **argv)
 
void v8toolkit::expose_gc ()
 
void v8toolkit::add_variable (v8::Isolate *isolate, const v8::Local< v8::ObjectTemplate > &object_template, const char *name, const v8::Local< v8::Data > value)
 
void v8toolkit::add_variable (const v8::Local< v8::Context > context, const v8::Local< v8::Object > &object, const char *name, const v8::Local< v8::Value > value)
 
void v8toolkit::add_function (v8::Isolate *isolate, const v8::Local< v8::ObjectTemplate > &object_template, const char *name, void(*function)(const v8::FunctionCallbackInfo< v8::Value > &))
 
std::string v8toolkit::_format_helper (const v8::FunctionCallbackInfo< v8::Value > &args, bool append_newline)
 
std::string v8toolkit::_printf_helper (const v8::FunctionCallbackInfo< v8::Value > &args, bool append_newline)
 
std::vector< v8::Local< v8::Value > > v8toolkit::get_all_values (const v8::FunctionCallbackInfo< v8::Value > &args, int depth=1)
 
std::string v8toolkit::_print_helper (const v8::FunctionCallbackInfo< v8::Value > &args, bool append_newline)
 
void v8toolkit::add_print (v8::Isolate *isolate, v8::Local< v8::ObjectTemplate > object_template, func::function< void(const std::string &)>=[](const std::string &s){printf("%s", s.c_str());})
 
void v8toolkit::add_print (const v8::Local< v8::Context > context, func::function< void(const std::string &)> callback=[](const std::string &s){printf("%s", s.c_str());})
 
void v8toolkit::add_assert (v8::Isolate *isolate, v8::Local< v8::ObjectTemplate > object_template)
 
bool v8toolkit::get_file_contents (std::string filename, std::string &file_contents)
 
bool v8toolkit::get_file_contents (std::string filename, std::string &file_contents, time_t &file_modification_time)
 
bool v8toolkit::_get_modification_time_of_filename (std::string filename, time_t &modification_time)
 
void v8toolkit::delete_require_cache_for_isolate (v8::Isolate *isolate)
 
cached_isolate_modules_t & v8toolkit::get_loaded_modules (v8::Isolate *isolate)
 
bool v8toolkit::compile_source (v8::Local< v8::Context > &context, std::string source, v8::Local< v8::Script > &script, v8::Local< v8::Value > &error, v8::ScriptOrigin *script_origin=nullptr)
 
v8::Local< v8::Value > v8toolkit::run_script (v8::Local< v8::Context > context, v8::Local< v8::Script > script)
 
v8::Local< v8::Value > v8toolkit::execute_module (v8::Local< v8::Context > context, const std::string module_source, const v8::ScriptOrigin &script_origin, v8::Local< v8::Function > &compiled_function)
 
bool v8toolkit::require (v8::Local< v8::Context > context, std::string filename, v8::Local< v8::Value > &result, const std::vector< std::string > &paths, bool track_modification_times=false, bool use_cache=true, func::function< void(RequireResult const &)> callback=func::function< void(RequireResult const &)>(), func::function< std::string(std::string const &)> resource_name_callback=func::function< std::string(std::string const &)>())
 
void v8toolkit::add_module_list (v8::Isolate *isolate, const v8::Local< v8::ObjectTemplate > &object_template)
 
void v8toolkit::add_require (v8::Isolate *isolate, const v8::Local< v8::ObjectTemplate > &context, const std::vector< std::string > &paths)
 
void v8toolkit::require_directory (v8::Local< v8::Context > context, std::string directory_name)
 
void v8toolkit::dump_prototypes (v8::Isolate *isolate, v8::Local< v8::Object > object)
 
bool v8toolkit::compare_contents (v8::Isolate *isolate, const v8::Local< v8::Value > &left, const v8::Local< v8::Value > &right)
 
std::vector< std::string > v8toolkit::get_interesting_properties (v8::Local< v8::Context > context, v8::Local< v8::Object > object)
 
SetWeakCallbackData * v8toolkit::global_set_weak (v8::Isolate *isolate, const v8::Local< v8::Object > &javascript_object, func::function< void(v8::WeakCallbackInfo< SetWeakCallbackData > const &)> callback, bool destructive)
 
void v8toolkit::foreach_filesystem_helper (const std::string &directory_name, const volatile bool files, const volatile bool directories, std::function< void(const std::string &)> const &callback)
 
void v8toolkit::foreach_file (const std::string &directory_name, std::function< void(const std::string &)> const &callback)
 
void v8toolkit::foreach_directory (const std::string &directory_name, std::function< void(const std::string &)> const &callback)
 

Variables

std::mutex v8toolkit::require_results_mutex
 
static std::map< v8::Isolate *, cached_isolate_modules_t > v8toolkit::require_results
 

Function Documentation

void* operator new[] ( size_t  size,
const char *  pName,
int  flags,
unsigned  debugFlags,
const char *  file,
int  line 
)

Definition at line 26 of file v8toolkit.cpp.

void* operator new[] ( size_t  size,
size_t  alignment,
size_t  alignmentOffset,
const char *  pName,
int  flags,
unsigned  debugFlags,
const char *  file,
int  line 
)

Definition at line 31 of file v8toolkit.cpp.