FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void IDispatchAPI::SetProperty ( int  idx,
const FB::variant value 
)
virtual

Sets the value of an indexed property.

This can be used for providing array-style access on your object. For example, the following will result in a call to SetProperty with idx = 12:

document.getElementById("plugin")[12] = "property value";
Parameters
idxZero-based index of the property to set the value of.
valueThe new property value.

Implements FB::JSAPI.

Definition at line 420 of file IDispatchAPI.cpp.

References FB::variant::convert_cast().

421 {
422  if (is_JSAPI) {
423  FB::JSAPIPtr tmp = inner.lock();
424  if (tmp)
425  tmp->SetProperty(idx, value);
426  }
427 
428  FB::variant sIdx(idx);
429  SetProperty(sIdx.convert_cast<std::string>(), value);
430 }
void SetProperty(const std::string &propertyName, const FB::variant &value)
Sets the value of a property.
Accepts any datatype, used in all interactions with javascript. Provides tools for getting back out t...
Definition: variant.h:198
boost::shared_ptr< FB::JSAPI > JSAPIPtr
Defines an alias for a JSAPI shared_ptr (you should never use a JSAPI* directly)
Definition: APITypes.h:94

Here is the call graph for this function: