Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_XMLSECURITY_SOURCE_XMLSEC_SAXHELPER_HXX
21 : #define INCLUDED_XMLSECURITY_SOURCE_XMLSEC_SAXHELPER_HXX
22 :
23 : #include "libxml/tree.h"
24 :
25 : #include <com/sun/star/xml/sax/SAXException.hpp>
26 : #include <com/sun/star/xml/sax/XAttributeList.hpp>
27 : #include <com/sun/star/xml/sax/XLocator.hpp>
28 : #include <com/sun/star/lang/XServiceInfo.hpp>
29 : #include <com/sun/star/xml/csax/XMLAttribute.hpp>
30 :
31 : /** This class represents a SAX handler which simply forwards to
32 : the corresponding libxml API and translates parameter if necessary.
33 : */
34 : class SAXHelper
35 : {
36 : private :
37 : xmlParserCtxtPtr m_pParserCtxt ;
38 : xmlSAXHandlerPtr m_pSaxHandler ;
39 :
40 : public:
41 : SAXHelper( ) ;
42 : virtual ~SAXHelper() ;
43 :
44 1 : xmlNodePtr getCurrentNode() { return m_pParserCtxt->node;}
45 : void setCurrentNode(const xmlNodePtr pNode);
46 1 : xmlDocPtr getDocument() { return m_pParserCtxt->myDoc;}
47 :
48 : void startDocument()
49 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
50 :
51 : void endDocument()
52 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
53 :
54 : void startElement(
55 : const OUString& aName ,
56 : const com::sun::star::uno::Sequence<
57 : com::sun::star::xml::csax::XMLAttribute >& aAttributes )
58 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
59 :
60 : void endElement( const OUString& aName )
61 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
62 :
63 : void characters( const OUString& aChars )
64 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
65 :
66 : void ignorableWhitespace( const OUString& aWhitespaces )
67 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
68 :
69 : void processingInstruction(
70 : const OUString& aTarget ,
71 : const OUString& aData )
72 : throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ;
73 :
74 : } ;
75 :
76 : #endif
77 :
78 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|