Page tree
Skip to end of metadata
Go to start of metadata

bool FB::JSAPIAuto::HasProperty ( const std::string &  propertyName) const

Query if 'propertyName' is a valid property.

propertyNameName of the property.
true if property exists, false if not.

Implements FB::JSAPI.

Definition at line 162 of file JSAPIAuto.cpp.

163 {
164  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
165  if(!m_valid)
166  return false;
168  // To be able to set dynamic properties, we have to respond true always
169  if (m_allowDynamicAttributes && !HasMethod(propertyName) && !isReserved(propertyName))
170  return true;
171  else if (m_allowMethodObjects && HasMethod(propertyName) && memberAccessible(m_zoneMap.find(propertyName)))
172  return true;
174  return m_propertyFunctorsMap.find(propertyName) != m_propertyFunctorsMap.end()
175  || m_attributes.find(propertyName) != m_attributes.end();
176 }
bool isReserved(const std::string &propertyName) const
Returns true if the specified propertyName is a reserved attribute.
Definition: JSAPIAuto.h:168
virtual bool HasMethod(const std::string &methodName) const
Query if the JSAPI object has the 'methodName' method.
Definition: JSAPIAuto.cpp:146
  • No labels