示例#1
0
/* reader:read_state() */
static int xmlreader_read_state(lua_State *L) {
  xmlreader xr = check_xmlreader(L, 1);

  int state = xmlTextReaderReadState(xr);
  if (state != -1) {
    lua_pushstring(L, xmlreader_states[state]);
    return 1;
  }
  else {
    lua_pushnil(L);
    xmlreader_pusherror(L);
    return 2;
  }
}
示例#2
0
/*
 * call-seq:
 *   state
 *
 * Get the state of the reader
 */
static VALUE state(VALUE self)
{
  xmlTextReaderPtr reader;
  Data_Get_Struct(self, xmlTextReader, reader);
  return INT2NUM(xmlTextReaderReadState(reader));
}
 bool XMLReader::hasNode() const
 {
   return xmlTextReaderReadState(m_reader) != -1 ;
 }
示例#4
0
/*
 * call-seq:
 *    reader.read_state -> state
 *
 * Get the read state of the reader.
 */
static VALUE rxml_reader_read_state(VALUE self)
{
  return INT2FIX(xmlTextReaderReadState(rxml_text_reader_get(self)));
}
示例#5
0
/*
 * call-seq:
 *    reader.read_state -> state
 *
 * Get the read state of the reader.
 */
static VALUE rxml_reader_read_state(VALUE self)
{
  xmlTextReaderPtr xreader = rxml_text_reader_get(self);
  return INT2FIX(xmlTextReaderReadState(xreader));
}
示例#6
0
文件: xml.cpp 项目: coinhelper/coin
ReadState XmlTextReader::get_ReadState() const {
	if (m_p)
		return (Ext::ReadState)XmlCheck(xmlTextReaderReadState(ToReader(m_p)));
	return Ext::ReadState::Closed;	
}
示例#7
0
文件: xmlreader.c 项目: matsuu/konoha
/* @method Int XmlReader.readState() */
METHOD XmlReader_readState(Ctx *ctx, knh_sfp_t *sfp)
{
    xmlTextReaderPtr reader = (xmlTextReaderPtr) p_cptr(sfp[0]);
    int ret = xmlTextReaderReadState(reader);
    KNH_RETURN_Int(ctx,sfp,ret);
}
示例#8
0
//## @Native int XmlReader.readState();
static KMETHOD XmlReader_readState(KonohaContext *kctx, KonohaStack *sfp)
{
	xmlTextReaderPtr reader = getRawXmlReader(sfp[0]);
	int ret = (reader != NULL) ? xmlTextReaderReadState(reader) : 0;
	KReturnUnboxValue(ret);
}