FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
variant JSAPISimple::GetProperty ( int  idx)
virtual

Gets 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 GetProperty with idx = 12:

var i = document.getElementById("plugin")[12];
Parameters
idxZero-based index of the property to get the value of.
Returns
The property value.

Implements FB::JSAPI.

Definition at line 165 of file JSAPISimple.cpp.

166 {
167  if (!m_valid)
168  throw object_invalidated();
169 
170  // By default do not support indexing
171  // To use array style access, override this method in your API object
172  throw invalid_member("Array index: " + variant(idx).convert_cast<std::string>());
173 }
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