diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-09-18 18:06:36 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-09-20 08:32:39 +0000 |
commit | b7c41f1d1fcabc8f4abc670d5a18546a117b540a (patch) | |
tree | aad89133f57f8d7d5d3cb76d0dec7243f1c40a88 /sax/source | |
parent | cf480d6c37e8c58972ee8a3e3ce04747f3ae0b5e (diff) |
unusedcode: FastSaxSerializer is not used through UNO
Change-Id: I07d7b78be200f5f4a0674361237ef45b2bd1e3e1
Reviewed-on: https://gerrit.libreoffice.org/651
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 97 | ||||
-rw-r--r-- | sax/source/tools/fastserializer.hxx | 93 |
2 files changed, 61 insertions, 129 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index bd84747cb527..d12e7711acc1 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -45,8 +45,6 @@ using ::com::sun::star::xml::FastAttribute; using ::com::sun::star::xml::Attribute; using ::com::sun::star::xml::sax::SAXException; using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastTokenHandler; -using ::com::sun::star::xml::sax::XFastSerializer; using ::com::sun::star::io::XOutputStream; using ::com::sun::star::io::NotConnectedException; using ::com::sun::star::io::IOException; @@ -145,27 +143,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maClosingBracket)); } - void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracket)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeFastAttributeList(Attribs); - - writeBytes(toUnoSequence(maClosingBracket)); - } - void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element ) throw (SAXException, RuntimeException) { @@ -179,25 +156,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maClosingBracket)); } - void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracketAndSlash)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeBytes(toUnoSequence(maClosingBracket)); - } - void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs ) throw (SAXException, RuntimeException) { @@ -215,27 +173,6 @@ namespace sax_fastparser { writeBytes(toUnoSequence(maSlashAndClosingBracket)); } - void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) - throw (SAXException, RuntimeException) - { - if (!mxOutputStream.is()) - return; - - writeBytes(toUnoSequence(maOpeningBracket)); - - if (!Namespace.isEmpty()) - { - write(Namespace); - writeBytes(toUnoSequence(maColon)); - } - - write(Name); - - writeFastAttributeList(Attribs); - - writeBytes(toUnoSequence(maSlashAndClosingBracket)); - } - void SAL_CALL FastSaxSerializer::characters( const OUString& aChars ) throw (SAXException, RuntimeException) { @@ -289,40 +226,6 @@ namespace sax_fastparser { } } - // XServiceInfo - OUString FastSaxSerializer::getImplementationName() throw (RuntimeException) - { - return OUString( SERIALIZER_IMPLEMENTATION_NAME ); - } - - // XServiceInfo - sal_Bool FastSaxSerializer::supportsService(const OUString& ServiceName) throw (RuntimeException) - { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; - } - - // XServiceInfo - Sequence< OUString > FastSaxSerializer::getSupportedServiceNames(void) throw (RuntimeException) - { - Sequence<OUString> seq(1); - seq.getArray()[0] = OUString( SERIALIZER_SERVICE_NAME ); - return seq; - } - - Sequence< OUString > FastSaxSerializer::getSupportedServiceNames_Static(void) - { - Sequence<OUString> aRet(1); - aRet.getArray()[0] = OUString( SERIALIZER_SERVICE_NAME ); - return aRet; - } - void FastSaxSerializer::mark( Int32Sequence aOrder ) { if ( aOrder.hasElements() ) diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index 13e047e5a373..b80f1ccaecc2 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -20,11 +20,8 @@ #ifndef SAX_FASTSERIALIZER_HXX #define SAX_FASTSERIALIZER_HXX -#include <com/sun/star/xml/sax/XFastSerializer.hpp> #include <com/sun/star/xml/sax/XFastTokenHandler.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/io/XOutputStream.hpp> -#include <cppuhelper/implbase2.hxx> #include <rtl/byteseq.hxx> #include <stack> @@ -34,54 +31,86 @@ #include "sax/fshelper.hxx" -#define SERIALIZER_IMPLEMENTATION_NAME "com.sun.star.comp.extensions.xml.sax.FastSerializer" -#define SERIALIZER_SERVICE_NAME "com.sun.star.xml.sax.FastSerializer" - namespace sax_fastparser { -class FastSaxSerializer : public ::cppu::WeakImplHelper2< ::com::sun::star::xml::sax::XFastSerializer, ::com::sun::star::lang::XServiceInfo > +/// Receives notification of sax document events to write into an XOutputStream. +class FastSaxSerializer { typedef ::com::sun::star::uno::Sequence< ::sal_Int8 > Int8Sequence; typedef ::com::sun::star::uno::Sequence< ::sal_Int32 > Int32Sequence; public: - explicit FastSaxSerializer( ); - virtual ~FastSaxSerializer(); + explicit FastSaxSerializer(); + ~FastSaxSerializer(); ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > getOutputStream() {return mxOutputStream;} - // The implementation details - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void); + /** called by the parser when parsing of an XML stream is started. + */ + void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - // XFastSerializer - virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) - throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name ) + /** called by the parser after the last XML element of a stream is processed. + */ + void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); + + /** receives notification of the beginning of an element. + + @param Element + contains the integer token from the <type>XFastTokenHandler</type> + registered at the <type>XFastParser</type>.<br> + + If the element has a namespace that was registered with the + <type>XFastParser</type>, <param>Element</param> contains the integer + token of the elements local name from the <type>XFastTokenHandler</type> + and the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @param Attribs + Contains a <type>XFastAttrbitueList</type> to access the attributes + from the element. + + */ + void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL singleFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) + + /** receives notification of the end of an known element. + @see startFastElement + */ + void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL singleUnknownElement( const ::rtl::OUString& Namespace, const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) + + /** receives notification of the beginning of a single element. + + @param Element + contains the integer token from the <type>XFastTokenHandler</type> + registered at the <type>XFastParser</type>.<br> + + If the element has a namespace that was registered with the + <type>XFastParser</type>, <param>Element</param> contains the integer + token of the elements local name from the <type>XFastTokenHandler</type> + and the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @param Attribs + Contains a <type>XFastAttrbitueList</type> to access the attributes + from the element. + + */ + void SAL_CALL singleFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) + + /// receives notification of character data. + void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setFastTokenHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xFastTokenHandler ) + + void SAL_CALL setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream ) throw (::com::sun::star::uno::RuntimeException); - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw ( ::com::sun::star::uno::RuntimeException ); + void SAL_CALL setFastTokenHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xFastTokenHandler ) + throw (::com::sun::star::uno::RuntimeException); // C++ helpers - virtual void SAL_CALL writeId( ::sal_Int32 Element ); + void SAL_CALL writeId( ::sal_Int32 Element ); static ::rtl::OUString escapeXml( const ::rtl::OUString& s ); |