FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
bool NPObjectAPI::HasProperty ( int  idx) const
virtual

Query if the property at "idx" exists.

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

document.getElementById("plugin")[12];
Parameters
idxZero-based index of the property to check for
Returns
true if property exists, false if not.

Implements FB::JSAPI.

Definition at line 142 of file NPObjectAPI.cpp.

143 {
144  if (m_browser.expired())
145  return false;
146 
147  NpapiBrowserHostPtr browser(getHost());
148  if (is_JSAPI) {
149  FB::JSAPIPtr tmp = inner.lock();
150  if (tmp)
151  return tmp->HasProperty(idx);
152  else
153  return false;
154  }
155  return browser->HasProperty(obj, browser->GetIntIdentifier(idx));
156 }
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