LibreOffice Module oox (master)  1
vmlinputstream.hxx
Go to the documentation of this file.
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_OOX_VML_VMLINPUTSTREAM_HXX
21 #define INCLUDED_OOX_VML_VMLINPUTSTREAM_HXX
22 
23 #include <com/sun/star/io/XInputStream.hpp>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <cppuhelper/implbase.hxx>
28 #include <rtl/string.hxx>
29 #include <sal/types.h>
30 
31 namespace com::sun::star {
32  namespace io { class XTextInputStream2; }
33  namespace uno { class XComponentContext; }
34 }
35 
36 namespace oox::vml {
37 
38 
56 class InputStream final : public ::cppu::WeakImplHelper< css::io::XInputStream >
57 {
58 public:
59  explicit InputStream(
60  const css::uno::Reference< css::uno::XComponentContext >& rxContext,
61  const css::uno::Reference< css::io::XInputStream >& rxInStrm );
62  virtual ~InputStream() override;
63 
64  virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& rData, sal_Int32 nBytesToRead ) override;
65  virtual sal_Int32 SAL_CALL readSomeBytes( css::uno::Sequence< sal_Int8 >& rData, sal_Int32 nMaxBytesToRead ) override;
66  virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) override;
67  virtual sal_Int32 SAL_CALL available() override;
68  virtual void SAL_CALL closeInput() override;
69 
70 private:
73  void updateBuffer();
76  OString readToElementBegin();
79  OString readToElementEnd();
80 
81 private:
82  css::uno::Reference< css::io::XTextInputStream2 >
84  css::uno::Sequence< sal_Unicode > maOpeningBracket;
85  css::uno::Sequence< sal_Unicode > maClosingBracket;
86  OString maBuffer;
87  sal_Int32 mnBufferPos;
88 };
89 
90 
91 } // namespace oox::vml
92 
93 #endif
94 
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
exports com.sun.star. io
virtual void SAL_CALL closeInput() override
const ContentProperties & rData
virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) override
virtual sal_Int32 SAL_CALL available() override
An input stream class for VML streams, implementing the UNO interface com.sun.star.io.XInputStream needed by the Expat XML parsers.
virtual sal_Int32 SAL_CALL readBytes(css::uno::Sequence< sal_Int8 > &rData, sal_Int32 nBytesToRead) override
css::uno::Sequence< sal_Unicode > maClosingBracket
virtual sal_Int32 SAL_CALL readSomeBytes(css::uno::Sequence< sal_Int8 > &rData, sal_Int32 nMaxBytesToRead) override
InputStream(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm)
virtual ~InputStream() override
css::uno::Reference< css::io::XTextInputStream2 > mxTextStrm
css::uno::Sequence< sal_Unicode > maOpeningBracket