IWAObjectIndex.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libetonyek 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
10#ifndef IWAOBJECTINDEX_H_INCLUDED
11#define IWAOBJECTINDEX_H_INCLUDED
12
13#include <map>
14#include <string>
15#include <utility>
16
17#include <boost/optional.hpp>
18
19#include "libetonyek_utils.h"
20
21namespace libetonyek
22{
23
24class IWAMessage;
25
27{
28public:
30 {
32 ObjectRecord(const RVNGInputStreamPtr_t &stream, unsigned type, long pos, unsigned long headerLen, unsigned long dataLen);
33
35 unsigned m_type;
36 std::pair<long, long> m_headerRange;
37 std::pair<long, long> m_dataRange;
38 };
39
40public:
41 IWAObjectIndex(const RVNGInputStreamPtr_t &fragments, const RVNGInputStreamPtr_t &package);
42
43 void parse();
44
45 void queryObject(unsigned id, unsigned &type, boost::optional<IWAMessage> &msg) const;
46 const RVNGInputStreamPtr_t queryFile(unsigned id) const;
47
48private:
49 void scanFragment(unsigned id);
50 void scanFragment(unsigned id, const RVNGInputStreamPtr_t &stream);
51
52private:
55
56 mutable std::map<unsigned, std::string> m_unparsedFragments;
57 mutable std::map<unsigned, std::pair<unsigned, ObjectRecord>> m_fragmentObjectMap;
58 mutable std::map<unsigned, std::pair<std::string, RVNGInputStreamPtr_t>> m_fileMap;
59};
60
61}
62
63#endif
64
65/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition IWAObjectIndex.h:27
void scanFragment(unsigned id)
Definition IWAObjectIndex.cpp:140
void queryObject(unsigned id, unsigned &type, boost::optional< IWAMessage > &msg) const
Definition IWAObjectIndex.cpp:103
std::map< unsigned, std::string > m_unparsedFragments
Definition IWAObjectIndex.h:56
const RVNGInputStreamPtr_t m_fragments
Definition IWAObjectIndex.h:53
std::map< unsigned, std::pair< unsigned, ObjectRecord > > m_fragmentObjectMap
Definition IWAObjectIndex.h:57
const RVNGInputStreamPtr_t queryFile(unsigned id) const
Definition IWAObjectIndex.cpp:121
std::map< unsigned, std::pair< std::string, RVNGInputStreamPtr_t > > m_fileMap
Definition IWAObjectIndex.h:58
void parse()
Definition IWAObjectIndex.cpp:53
const RVNGInputStreamPtr_t m_package
Definition IWAObjectIndex.h:54
Definition IWORKBezierElement.cpp:21
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition libetonyek_utils.h:82
Definition IWAObjectIndex.h:30
unsigned m_type
Definition IWAObjectIndex.h:35
std::pair< long, long > m_dataRange
Definition IWAObjectIndex.h:37
ObjectRecord()
Definition IWAObjectIndex.cpp:27
RVNGInputStreamPtr_t m_stream
Definition IWAObjectIndex.h:34
std::pair< long, long > m_headerRange
Definition IWAObjectIndex.h:36

Generated for libetonyek by doxygen 1.9.8