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

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";
idxZero-based index of the property to set the value of.
valueThe new property value.

Implements FB::JSAPI.

Definition at line 175 of file JSAPISimple.cpp.

176 {
177  if (!m_valid)
178  throw object_invalidated();
180  // By default do not support indexing
181  // To use array style access, override this method in your API object
182  throw invalid_member("Array index: " + variant(idx).convert_cast<std::string>());
183 }
Accepts any datatype, used in all interactions with javascript. Provides tools for getting back out t...
Definition: variant.h:198
Thrown by a JSAPI object when a call is made on it after the object has been invalidated.
Definition: JSExceptions.h:69
Thrown when an Invoke, SetProperty, or GetProperty call is made for a member that is invalid (does no...
Definition: JSExceptions.h:83