flusspferd Namespace Reference

Flusspferd's main namespace. More...


Namespaces

namespace  detail
 Interpreter-independent implementation details.
namespace  encodings
namespace  io
 IO support.
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
class  current_context_scope
 Load a context while in scope. More...
class  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  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 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.
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.
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 ()
 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_core (object const &scope)
void load_require_function (object container)
 Load the 'require()' function into container.
template<typename T >
T & get_native (object const &o)
template<typename T >
bool is_derived (native_object_base &o)
template<typename T >
bool is_native (object const &o)
 Checks if o is a T.
void load_properties_functions (object o=global())
 Load the properties function Object.defineProperty modelled after [[DefineOwnProperty]] from the ES3.1 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 ()
Creating values
object create_object (object const &proto=object())
 Create a simple object.
array create_array (unsigned int length=0)
 Create an array.
template<typename T >
T & create_native_object (object const &proto,...)
 Create a new native object of type T.
Creating functions
function create_function (std::string const &name, unsigned n_args, std::vector< std::string > argnames, flusspferd::string const &body, std::string const &file, unsigned line)
function create_native_function (native_function_base *ptr)
 Create a new native function.
function create_native_function (object const &o, native_function_base *ptr)
 Create a new native function as method of an object.
template<typename F >
object create_native_functor_function (object const &o,...)
 Create a new native function of type F as method of an object.
function create_native_function (object const &o, std::string const &name, boost::function< void(call_context &)> const &fn, unsigned arity=0)
 Create a new native method of an object.
template<typename T >
function create_native_function (object const &o, std::string const &name, boost::function< T > const &fn)
 Create a new native method of an object.
template<typename T >
function create_native_method (object const &o, std::string const &name, boost::function< T > const &fn)
 Create a new native method of an object.
template<typename T >
function create_native_function (object const &o, std::string const &name, T *fnptr, typename boost::enable_if_c< boost::is_function< T >::value >::type *=0)
 Create a new native method of an object.
template<typename T >
function create_native_method (object const &o, std::string const &name, T *fnptr, typename boost::enable_if_c< boost::is_function< T >::value >::type *=0)
 Create a new native method of an object.
template<typename T >
function create_native_method (object const &o, std::string const &name, void(T::*memfnptr)(call_context &), unsigned arity=0)
 Create a new native method of an object.
template<typename R , typename T >
function create_native_method (object const &o, std::string const &name, R T::*memfnptr)
 Create a new native method of an object.
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_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 (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.


Detailed Description

Flusspferd's main namespace.


Typedef Documentation

typedef jschar flusspferd::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_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)

template<typename T >
T& flusspferd::get_native ( object const &  o  )  [inline]

object flusspferd::getopt ( object  spec,
boost::optional< array const & > const &  arguments = boost::none 
)

Parse the options.

Specification syntax:

{
  "name": {
    "alias": ["abc", "d"],
    "argument": "none", // or "optional" or "required"
    "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.

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_native ( object const &  o  )  [inline]

Checks if o is a T.

Parameters:
o object to check
See also:
get_native

void flusspferd::load_binary_module ( object  container  ) 

void flusspferd::load_core ( object const &  scope  ) 

void flusspferd::load_encodings_module ( object  container  ) 

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 Fri Sep 11 23:57:42 2009 for Flusspferd by doxygen 1.5.8