Esempio n. 1
0
bool c_XMLReader::t_getparserproperty(int64_t property) {
  int ret = 0;
  if (m_ptr) {
    ret = xmlTextReaderGetParserProp(m_ptr, property);
  }
  if (ret == -1) {
    raise_warning("Invalid parser property");
    return false;
  }
  return ret;
}
Esempio n. 2
0
bool c_XMLReader::t_getparserproperty(int64 property) {
  INSTANCE_METHOD_INJECTION_BUILTIN(XMLReader, XMLReader::getparserproperty);
  int ret = 0;
  if (m_ptr) {
    ret = xmlTextReaderGetParserProp(m_ptr, property);
  }
  if (ret == -1) {
    raise_warning("Invalid parser property");
    return false;
  }
  return ret;
}
Esempio n. 3
0
bool HHVM_METHOD(XMLReader, getParserProperty,
                 int64_t property) {
  auto* data = Native::data<XMLReader>(this_);
  int ret = 0;
  if (data->m_ptr) {
    ret = xmlTextReaderGetParserProp(data->m_ptr, property);
  }
  if (ret == -1) {
    raise_warning("Invalid parser property");
    return false;
  }
  return ret;
}
Esempio n. 4
0
static int xmlreader_get_parser_property(lua_State *L) {
  xmlreader xr = check_xmlreader(L, 1);
  int prop = luaL_checkoption(L, 2, NULL, xmlreader_properties);

  int ret = xmlTextReaderGetParserProp(xr, prop);
  if (ret != -1) {
    lua_pushinteger(L, ret);
    return 1;
  } else {
    lua_pushnil(L);
    xmlreader_pusherror(L);
    return 2;
  }
}
Esempio n. 5
0
/* {{{ proto boolean XMLReader::getParserProperty(int property)
Indicates whether given property (one of the parser option constants) is set or not on parser */
PHP_METHOD(xmlreader, getParserProperty)
{
	zval *id;
	zend_long property;
	int retval = -1;
	xmlreader_object *intern;

	if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &property) == FAILURE) {
		return;
	}

	id = getThis();

	intern = Z_XMLREADER_P(id);
	if (intern && intern->ptr) {
		retval = xmlTextReaderGetParserProp(intern->ptr,property);
	}
	if (retval == -1) {
		php_error_docref(NULL, E_WARNING, "Invalid parser property");
		RETURN_FALSE;
	}

	RETURN_BOOL(retval);
}