コード例 #1
0
	bool endDocument() override
	{
		KviKvsVariant ret;
		if(!m_pReader->callFunction(m_pReader, "onDocumentEnd", &ret))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}
コード例 #2
0
	virtual bool startDocument()
	{
		KviKvsVariant ret;
		if(!m_pReader->callFunction(m_pReader,"onDocumentStart",&ret))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}
コード例 #3
0
	bool characters(const QString & szChars) override
	{
		KviKvsVariant ret;
		KviKvsVariantList par;
		par.setAutoDelete(true);
		par.append(new KviKvsVariant(szChars));
		if(!m_pReader->callFunction(m_pReader, "onText", &ret, &par))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}
コード例 #4
0
	bool endElement(const QString & szNamespaceUri, const QString & szLocalName, const QString & szQualifiedName) override
	{
		KviKvsVariant ret;
		KviKvsVariantList par;
		par.setAutoDelete(true);
		par.append(new KviKvsVariant(szQualifiedName));
		par.append(new KviKvsVariant(szNamespaceUri));
		par.append(new KviKvsVariant(szLocalName));
		if(!m_pReader->callFunction(m_pReader, "onElementEnd", &ret, &par))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}
コード例 #5
0
	bool error(const QXmlParseException & exception) override
	{
		// recoverable
		QString szMsg;
		decodeException(szMsg, false, exception);

		KviKvsVariant ret;
		KviKvsVariantList par;
		par.setAutoDelete(true);
		par.append(new KviKvsVariant(szMsg));
		if(!m_pReader->callFunction(m_pReader, "onWarning", &ret, &par))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}
コード例 #6
0
	bool startElement(const QString & szNamespaceUri, const QString & szLocalName, const QString & szQualifiedName, const QXmlAttributes & attrs) override
	{
		KviKvsVariant ret;
		KviKvsVariantList par;
		par.setAutoDelete(true);
		par.append(new KviKvsVariant(szQualifiedName));
		KviKvsHash * pHash = new KviKvsHash();
		par.append(new KviKvsVariant(pHash));
		par.append(new KviKvsVariant(szNamespaceUri));
		par.append(new KviKvsVariant(szLocalName));
		int c = attrs.count();
		for(int i = 0; i < c; i++)
			pHash->set(attrs.qName(i), new KviKvsVariant(attrs.value(i)));
		if(!m_pReader->callFunction(m_pReader, "onElementStart", &ret, &par))
			return kvsCodeFailure();
		return handleKvsCallReturnValue(&ret);
	}