1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
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>
35 class StorageXMLOutputStream
: public StorageOutputStream
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
;
47 void addAttribute( const OUString
& i_rName
, const OUString
& i_rValue
) const;
49 void startElement( const OUString
& i_rElementName
);
52 void ignorableWhitespace( const OUString
& i_rWhitespace
) const;
53 void characters( const OUString
& i_rCharacters
) const;
56 StorageXMLOutputStream( const StorageXMLOutputStream
& ) = delete;
57 StorageXMLOutputStream
& operator=( const StorageXMLOutputStream
& ) = delete;
60 css::uno::Reference
< css::xml::sax::XDocumentHandler
> mxHandler
;
61 std::stack
< OUString
> maElements
;
62 ::rtl::Reference
<comphelper::AttributeList
> mxAttributes
;
65 class StorageXMLInputStream
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();
76 const css::uno::Reference
< css::xml::sax::XDocumentHandler
>& i_rHandler
79 StorageXMLInputStream( const StorageXMLInputStream
& ) = delete;
80 StorageXMLInputStream
& operator=( const StorageXMLInputStream
& ) = delete;
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: */