LibreOffice Module oox (master) 1
fastparser.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_CORE_FASTPARSER_HXX
21#define INCLUDED_OOX_CORE_FASTPARSER_HXX
22
23#include <com/sun/star/uno/Reference.hxx>
24#include <rtl/ustring.hxx>
25#include <rtl/ref.hxx>
26#include <sal/types.h>
27#include <oox/dllapi.h>
28
29namespace com::sun::star {
30 namespace io { class XInputStream; }
31 namespace uno { class XComponentContext; }
32 namespace xml::sax { class XFastDocumentHandler; }
33 namespace xml::sax { class XFastParser; }
34 namespace xml::sax { class XFastTokenHandler; }
35 namespace xml::sax { struct InputSource; }
36}
37
38namespace oox {
39 struct NamespaceMap;
40 class StorageBase;
41}
42
43namespace sax_fastparser {
44 class FastSaxParser;
45}
46
47namespace oox::core {
48
49
54{
55public:
57 explicit FastParser();
58
59 FastParser(const FastParser&) = delete;
60 FastParser& operator=(const FastParser&) = delete;
61
63
68 void registerNamespace( sal_Int32 nNamespaceId );
69
73 void setDocumentHandler(
74 const css::uno::Reference< css::xml::sax::XFastDocumentHandler >& rxDocHandler );
75
76 void clearDocumentHandler();
77
84 void parseStream( const css::xml::sax::InputSource& rInputSource, bool bCloseStream = false );
85
93 const css::uno::Reference< css::io::XInputStream >& rxInStream,
94 const OUString& rStreamName );
95
102 void parseStream( StorageBase& rStorage, const OUString& rStreamName );
103
104 const css::uno::Reference< css::xml::sax::XFastTokenHandler >&
105 getTokenHandler() const { return mxTokenHandler; }
106
107private:
108 css::uno::Reference<css::xml::sax::XFastTokenHandler> mxTokenHandler;
111};
112
113
114} // namespace oox::core
115
116#endif
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for storage access implementations.
Definition: storagebase.hxx:52
Wrapper for a fast SAX parser that works on automatically generated OOXML token and namespace identif...
Definition: fastparser.hxx:54
void parseStream(const css::xml::sax::InputSource &rInputSource, bool bCloseStream=false)
Parses the passed SAX input source.
FastParser(const FastParser &)=delete
FastParser & operator=(const FastParser &)=delete
const NamespaceMap & mrNamespaceMap
Definition: fastparser.hxx:109
css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler
Definition: fastparser.hxx:108
void parseStream(const css::uno::Reference< css::io::XInputStream > &rxInStream, const OUString &rStreamName)
Parses the passed input stream.
rtl::Reference< sax_fastparser::FastSaxParser > mxParser
Definition: fastparser.hxx:110
const css::uno::Reference< css::xml::sax::XFastTokenHandler > & getTokenHandler() const
Definition: fastparser.hxx:105
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
A map that contains all XML namespace URLs used in the filters.