FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
FB::variant NPObjectAPI::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 232 of file NPObjectAPI.cpp.

References GetProperty().

233 {
234  if (m_browser.expired())
235  return FB::FBVoid();
236 
237  NpapiBrowserHostPtr browser(getHost());
238  std::string strIdx(boost::lexical_cast<std::string>(idx));
239  if (is_JSAPI) {
240  FB::JSAPIPtr tmp = inner.lock();
241  if (tmp)
242  return tmp->GetProperty(idx);
243  }
244  return GetProperty(strIdx);
245 }
variant GetProperty(const std::string &propertyName)
Gets a property value.
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: