tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / dbaccess / source / core / recovery / storagexmlstream.hxx
blob8a340b6fea0ca5aa9a8ccdbbca85df95420262d8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "storagestream.hxx"
24 #include <com/sun/star/xml/sax/XParser.hpp>
25 #include <com/sun/star/embed/XStorage.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
28 #include <comphelper/attributelist.hxx>
29 #include <rtl/ref.hxx>
30 #include <stack>
32 namespace dbaccess
35 class StorageXMLOutputStream : public StorageOutputStream
37 public:
38 StorageXMLOutputStream(
39 const css::uno::Reference< css::uno::XComponentContext >& i_rContext,
40 const css::uno::Reference< css::embed::XStorage >& i_rParentStorage,
41 const OUString& i_rStreamName
43 virtual ~StorageXMLOutputStream() override;
45 void close();
47 void addAttribute( const OUString& i_rName, const OUString& i_rValue ) const;
49 void startElement( const OUString& i_rElementName );
50 void endElement();
52 void ignorableWhitespace( const OUString& i_rWhitespace ) const;
53 void characters( const OUString& i_rCharacters ) const;
55 private:
56 StorageXMLOutputStream( const StorageXMLOutputStream& ) = delete;
57 StorageXMLOutputStream& operator=( const StorageXMLOutputStream& ) = delete;
59 private:
60 css::uno::Reference< css::xml::sax::XDocumentHandler > mxHandler;
61 std::stack< OUString > maElements;
62 ::rtl::Reference<comphelper::AttributeList> mxAttributes;
65 class StorageXMLInputStream
67 public:
68 StorageXMLInputStream(
69 const css::uno::Reference< css::uno::XComponentContext >& i_rContext,
70 const css::uno::Reference< css::embed::XStorage >& i_rParentStorage,
71 const OUString& i_rStreamName
73 ~StorageXMLInputStream();
75 void import(
76 const css::uno::Reference< css::xml::sax::XDocumentHandler >& i_rHandler
79 StorageXMLInputStream( const StorageXMLInputStream& ) = delete;
80 StorageXMLInputStream& operator=( const StorageXMLInputStream& ) = delete;
82 private:
83 css::uno::Reference< css::xml::sax::XParser > m_xParser;
84 css::uno::Reference< css::io::XInputStream > m_xInputStream;
87 } // namespace dbaccess
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */