flusspferd Namespace Reference

Flusspferd's main namespace. More...

Namespaces

namespace  aliases
namespace  detail
 

Interpreter-independent implementation details.


namespace  encodings
namespace  io
 

IO support.


namespace  param
namespace  xml
 

XML support.


Classes

class  arguments
 Holds the arguments for a Javascript function call. More...
class  array
 A class for holding a Javascript Array. More...
class  binary
class  byte_string
class  byte_array
struct  call_context
 Context information about a function call. More...
struct  class_info
 Information about classes exposed to javascript. More...
class  context
 Javascript context. More...
class  convert
struct  method
 Tag class for flusspferd::create. More...
class  create_on
 Create multiple values / objects / stuff on a container. More...
class  current_context_scope
 Load a context while in scope. More...
struct  exception
 Exception class. More...
class  js_quit
 Indicator exception. More...
class  function
 A Javascript function. More...
class  function_adapter
 Function adapter. More...
class  function_adapter_memfn
 Function adapter. More...
class  init
 Manage the current context and the initialisation of the Javascript engine. More...
class  local_root_scope
 Automatically root all newly created GC objects. More...
class  require
 Functor object that backs the require('foo') in JavaScript. More...
class  native_function
 Native function. More...
class  native_member_function
 Native member function. More...
class  native_function_base
 Native function base. More...
class  native_object_base
 Native object base. More...
class  object
 A Javascript object. More...
struct  property_attributes
 A property's attributes: flags, getters and setters. More...
class  property_iterator
 Property iterator. More...
class  security
class  string
 A Javascript string. More...
class  tracer
 Garbage collection tracer. More...
class  value
 Any Javascript value. More...

Typedefs

typedef void(* flusspferd_load_t )(object &exports, object &context)
 The prototype for module loader functions.
typedef detail::root< valueroot_value
 Javascript root scope for a flusspferd::value.
typedef detail::root< objectroot_object
 Javascript root scope for a flusspferd::object.
typedef detail::root< stringroot_string
 Javascript root scope for a flusspferd::string.
typedef detail::root< functionroot_function
 Javascript root scope for a flusspferd::function.
typedef detail::root< arrayroot_array
 Javascript root scope for a flusspferd::array.
typedef jschar js_char16_t

Enumerations

enum  property_flag {
  no_property_flag = 0U,
  dont_enumerate = 1U,
  read_only_property = 2U,
  permanent_property = 4U,
  shared_property = 8U,
  permanent_shared_property = 12U
}

Functions

void load_binary_module (object container)
template<typename T >
object load_class (object container=global())
 Expose a class to Javascript.
template<typename Class >
unspecified_type create (...)
 Create an object or value of a type implied by Class.
void load_encodings_module (object container)
template<typename T >
T & cast_to_derived (native_object_base &)
void load_getopt_module (object container)
object getopt (object spec, boost::optional< array const & > const &arguments=boost::none)
 Parse the options.
string getopt_help (object spec)
 Returns a help text to a corresponding getopt call.
string getopt_man (object spec)
 Returns a (nroff formated) manpage part to a corresponding getopt call.
string getopt_bash (object spec)
 Returns the content of a bash_completion function.
context enter_current_context (context const &c)
 Set the current context to c.
bool leave_current_context (context const &c)
 Unset the current context.
contextcurrent_context ()
 Get the current context.
object global ()
 Get the global object of the current context.
object scope_chain ()
 Get the global object of the current context.
void gc (bool maybe=false)
 Run the garbage collector on the current context.
template<typename T >
object prototype ()
 Get a prototype from the current context's prototype registry.
template<typename T >
object constructor ()
 Get a constructor from the current context's constructor registry.
object prototype (std::string const &ID)
 Get a prototype from the current context's prototype registry.
object constructor (std::string const &ID)
 Get a constructor from the current context's constructor registry.
void load_filesystem_base_module (object container)
void load_core (object const &scope, std::string const &argv0)
void load_flusspferd_module (object container, std::string const &argv0)
void load_require_function (object container)
 Load the 'require()' function into container.
template<typename T >
T & cast_to_derived (native_function_base &o)
template<typename T >
boost::enable_if< typename
boost::is_base_of
< native_function_base, T >
::type, T & >::type 
get_native (object const &o)
 Gets o as native function of class T.
template<typename T >
bool is_derived (native_function_base &o)
template<typename T >
boost::enable_if< typename
boost::is_base_of
< native_function_base, T >
::type, bool >::type 
is_native (object const &o)
 Checks if o is a native function of class T.
template<typename T >
bool is_derived (native_object_base &o)
void load_properties_functions (object o=global())
 Load the properties function Object.defineProperty and Object.defineProperties modelled after [[DefineOwnProperty]] from the ES6 specification.
property_flag operator& (property_flag a, property_flag b)
 Combine (intersection).
property_flag operator~ (property_flag x)
 Invert.
void load_system_module (object &context)
std::string version () FLUSSPFERD_PURE
bool is_relocatable () FLUSSPFERD_PURE
Evaluating Javascript source code



value evaluate (char const *source, std::size_t n, char const *file=0x0, unsigned int line=0)
 Evaluate Javascript code.
value evaluate (string const &source, char const *file=0x0, unsigned int line=0)
 Evaluate Javascript code.
value evaluate_in_scope (char const *source, std::size_t n, char const *file, unsigned int line, object const &scope)
 Evaluate Javascript code in a scope.
value evaluate_in_scope (std::string const &source, char const *file, unsigned int line, object const &scope)
 Evaluate Javascript code in a scope.
value evaluate_in_scope (char const *source, char const *file, unsigned int line, object const &scope)
 Evaluate Javascript code in a scope.
value evaluate_in_scope (string const &source, char const *file, unsigned int line, object const &scope)
 Evaluate Javascript code in a scope.
value evaluate (char const *source, char const *file=0x0, unsigned int line=0)
 Evaluate Javascript code.
value evaluate (std::string const &source, char const *file=0x0, unsigned int line=0)
 Evaluate Javascript code.
value execute (char const *file, object const &scope=object())
 Execute a Javascript file.
bool is_compilable (char const *source, std::size_t length, object const &scope=object())
 Check if the Code is Compileable.
bool is_compilable (char const *source, object const &scope=object())
 Check if the Code is Compileable.
bool is_compilable (std::string const &source, object const &scope=object())
 Check if the Code is Compileable.

Detailed Description

Flusspferd's main namespace.


Typedef Documentation

typedef jschar flusspferd::js_char16_t

Enumeration Type Documentation

Enumerator:
no_property_flag 

The property is normal.

dont_enumerate 

The property is not enumerable.

read_only_property 

The property is read-only.

permanent_property 

The property can not be deleted.

shared_property 

The property's attributes are shared between objects.

permanent_shared_property 

The property is both permanent and shared.


Function Documentation

template<typename T >
T& flusspferd::cast_to_derived ( native_function_base &  o  )  [inline]
template<typename T >
T & flusspferd::cast_to_derived ( native_object_base &  o  )  [inline]
object flusspferd::constructor ( std::string const &  ID  )  [inline]

Get a constructor from the current context's constructor registry.

See also:
current_context, context::constructor(const std::string & name) const
template<typename T >
object flusspferd::constructor (  )  [inline]

Get a constructor from the current context's constructor registry.

See also:
current_context, context::constructor(void)
object flusspferd::getopt ( object  spec,
boost::optional< array const & > const &  arguments = boost::none 
)

Parse the options.

Specification syntax:

{
  "[options]": {
    "stop-early": true //default: false
  },
  "name": {
    "alias": ["abc", "d"],
    "argument": "none", // or "optional" or "required"
    "argument_type": "file", // or "dir" or "module" or ...
    "argument_bash": "bash script", // completion script for unkown types
    "doc": "documentation string",
    "hidden": true, // optional. if true no documentation is generated
    "callback": myfunction // takes (option, argument)
  },
  "name2": {}
}
Returns:
{
  "name": ["arguments"],
  ...,
  "_": ["arguments"]
}

There are short options (-x) and long options (--xy). Short options cannot take optional arguments, they will always require arguments or not accept any at all.

string flusspferd::getopt_bash ( object  spec  ) 

Returns the content of a bash_completion function.

Has completions for all argument types supported by compgen/complete -A. See http://www.gnu.org/software/bash/manual/bashref.html#Programmable-Completion-Builtins Use the "argument_bash" property for your own completion scripts.

 cout << "_foo() {\n" + getopt_bash(spec) + "}\ncomplete -F _foo foo\n";
string flusspferd::getopt_help ( object  spec  ) 

Returns a help text to a corresponding getopt call.

string flusspferd::getopt_man ( object  spec  ) 

Returns a (nroff formated) manpage part to a corresponding getopt call.

object flusspferd::global (  )  [inline]

Get the global object of the current context.

See also:
current_context, context::global
template<typename T >
bool flusspferd::is_derived ( native_object_base &  o  )  [inline]
template<typename T >
bool flusspferd::is_derived ( native_function_base &  o  )  [inline]
bool flusspferd::is_relocatable (  ) 
void flusspferd::load_binary_module ( object  container  ) 
void flusspferd::load_core ( object const &  scope,
std::string const &  argv0 
)
void flusspferd::load_encodings_module ( object  container  ) 
void flusspferd::load_filesystem_base_module ( object  container  ) 
void flusspferd::load_flusspferd_module ( object  container,
std::string const &  argv0 
)
void flusspferd::load_getopt_module ( object  container  ) 
void flusspferd::load_system_module ( object &  context  ) 
property_flag flusspferd::operator& ( property_flag  a,
property_flag  b 
) [inline]

Combine (intersection).

property_flag flusspferd::operator~ ( property_flag  x  )  [inline]

Invert.

object flusspferd::prototype ( std::string const &  ID  )  [inline]

Get a prototype from the current context's prototype registry.

See also:
current_context, context::prototype(const std::string &name) const
template<typename T >
object flusspferd::prototype (  )  [inline]

Get a prototype from the current context's prototype registry.

See also:
current_context, context::prototype(void)
object flusspferd::scope_chain (  )  [inline]

Get the global object of the current context.

See also:
current_context, context::scope_chain
std::string flusspferd::version (  ) 

Contact us at team -AT- flusspferd -DOT- org or as described on our homepage.

Generated on Thu Feb 4 23:05:23 2010 for Flusspferd by doxygen 1.6.1