LibreOffice Module oox (master)  1
recordparser.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_RECORDPARSER_HXX
21 #define INCLUDED_OOX_CORE_RECORDPARSER_HXX
22 
23 #include <map>
24 #include <memory>
25 
28 #include <rtl/ref.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
31 
32 namespace oox {
33 namespace core {
34 
35 namespace prv {
36  class ContextStack;
37  class Locator;
38 }
39 
40 
42 {
44  OUString maSystemId;
45 };
46 
47 
48 class RecordParser final
49 {
50 public:
51  RecordParser();
52  ~RecordParser();
53 
54  void setFragmentHandler( const ::rtl::Reference< FragmentHandler >& rxHandler );
55 
59  void parseStream( const RecordInputSource& rInputSource );
60 
61  const RecordInputSource& getInputSource() const { return maSource; }
62 
63 private:
66  const RecordInfo* getStartRecordInfo( sal_Int32 nRecId ) const;
69  const RecordInfo* getEndRecordInfo( sal_Int32 nRecId ) const;
70 
71 private:
72  typedef ::std::map< sal_Int32, RecordInfo > RecordInfoMap;
73 
77  ::std::unique_ptr< prv::ContextStack > mxStack;
78  RecordInfoMap maStartMap;
79  RecordInfoMap maEndMap;
80 };
81 
82 
83 } // namespace core
84 } // namespace oox
85 
86 #endif
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Describes record identifiers used to create contexts in a binary stream.
void parseStream(const RecordInputSource &rInputSource)
::rtl::Reference< prv::Locator > mxLocator
void setFragmentHandler(const ::rtl::Reference< FragmentHandler > &rxHandler)
std::shared_ptr< BinaryInputStream > BinaryInputStreamRef
const RecordInfo * getEndRecordInfo(sal_Int32 nRecId) const
Returns a RecordInfo struct that contains the passed record identifier as context end identifier...
const RecordInfo * getStartRecordInfo(sal_Int32 nRecId) const
Returns a RecordInfo struct that contains the passed record identifier as context start identifier...
::std::unique_ptr< prv::ContextStack > mxStack
RecordInfoMap maStartMap
const RecordInputSource & getInputSource() const
BinaryInputStreamRef mxInStream
RecordInputSource maSource
::std::map< sal_Int32, RecordInfo > RecordInfoMap
::rtl::Reference< FragmentHandler > mxHandler