LibreOffice Module oox (master) 1
textinputstream.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_HELPER_TEXTINPUTSTREAM_HXX
21#define INCLUDED_OOX_HELPER_TEXTINPUTSTREAM_HXX
22
23#include <com/sun/star/uno/Reference.hxx>
24#include <rtl/textenc.h>
25#include <rtl/ustring.hxx>
26#include <sal/types.h>
27
28namespace com::sun::star {
29 namespace io { class XInputStream; }
30 namespace io { class XTextInputStream2; }
31 namespace uno { class XComponentContext; }
32}
33
34namespace oox {
35
36class BinaryInputStream;
37
38
40{
41public:
43 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
44 const css::uno::Reference< css::io::XInputStream >& rxInStrm,
45 rtl_TextEncoding eTextEnc );
46
48 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
49 BinaryInputStream& rInStrm,
50 rtl_TextEncoding eTextEnc );
51
53
56 bool isEof() const;
57
66 OUString readLine();
67
89 OUString readToChar( sal_Unicode cChar, bool bIncludeChar );
90
91
94 static css::uno::Reference< css::io::XTextInputStream2 >
96 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
97 const css::uno::Reference< css::io::XInputStream >& rxInStrm,
98 rtl_TextEncoding eTextEnc );
99
100
101private:
102 void init(
103 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
104 const css::uno::Reference< css::io::XInputStream >& rxInStrm,
105 rtl_TextEncoding eTextEnc );
106
108 OUString createFinalString( const OUString& rString );
109
110private:
111 css::uno::Reference< css::io::XTextInputStream2 >
114};
115
116
117} // namespace oox
118
119#endif
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface for binary input stream classes.
TextInputStream(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
css::uno::Reference< css::io::XTextInputStream2 > mxTextStrm
OUString createFinalString(const OUString &rString)
Adds the pending character in front of the passed string, if existing.
bool isEof() const
Returns true, if no more text is available in the stream.
void init(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
OUString readLine()
Reads a text line from the stream.
static css::uno::Reference< css::io::XTextInputStream2 > createXTextInputStream(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
Creates a UNO text input stream object from the passed UNO input stream.
OUString readToChar(sal_Unicode cChar, bool bIncludeChar)
Reads a text portion from the stream until the specified character is found.
TextInputStream(const css::uno::Reference< css::uno::XComponentContext > &rxContext, BinaryInputStream &rInStrm, rtl_TextEncoding eTextEnc)
sal_uInt16 sal_Unicode