FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void FB::JSAPISimple::registerMethod ( const std::string &  name,
CallMethodPtr  func 

Register a method to be exposed to javascript.

All methods exposed to javascript through JSAPISimple must match the FB::CallMethodPtr function pointer type. Example:

This matches the following definition:
variant callToString(const std::vector<variant>& args);
nameThe name that the method should be exposed to javascript as
funcThe function that should be called to handle the javascript method

Definition at line 80 of file JSAPISimple.cpp.

81 {
82  m_methodMap[name].callFunc = func;
83 }