QXPBlockParser.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 libqxp 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 QXPBLOCKPARSER_H_INCLUDED
11 #define QXPBLOCKPARSER_H_INCLUDED
12
13 #include "libqxp_utils.h"
14
15 namespace libqxp
16 {
17
18 class QXPHeader;
19
20 class QXPBlockParser
21 {
22 // disable copying
23 QXPBlockParser(const QXPBlockParser &other) = delete;
24 QXPBlockParser &operator=(const QXPBlockParser &other) = delete;
25
26 public:
27 QXPBlockParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, const std::shared_ptr<QXPHeader> &header);
28
29 std::shared_ptr<librevenge::RVNGInputStream> getBlock(const uint32_t index);
30 std::shared_ptr<librevenge::RVNGInputStream> getChain(const uint32_t index);
31
32 private:
33 const std::shared_ptr<librevenge::RVNGInputStream> m_input;
34 const std::shared_ptr<QXPHeader> m_header;
35 const bool be; // big endian
36
37 const unsigned long m_length;
38 const uint32_t m_blockLength;
39 const uint32_t m_lastBlock;
40 };
41
42 }
43
44 #endif // QXPBLOCKPARSER_H_INCLUDED
45
46 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libqxp::readS32
int32_t readS32(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:164
libqxp::readU16
uint16_t readU16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:111
libqxp
Definition: libqxp_utils.cpp:24
libqxp::readS16
int16_t readS16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:159
libqxp::seek
void seek(librevenge::RVNGInputStream *const input, const unsigned long pos)
Definition: libqxp_utils.cpp:241
libqxp_utils.h
libqxp::QXPBlockParser::m_blockLength
const uint32_t m_blockLength
Definition: QXPBlockParser.h:38
QXPMemoryStream.h
libqxp::QXPBlockParser::operator=
QXPBlockParser & operator=(const QXPBlockParser &other)=delete
QXPBlockParser.h
libqxp::QXPBlockParser::getBlock
std::shared_ptr< librevenge::RVNGInputStream > getBlock(const uint32_t index)
Definition: QXPBlockParser.cpp:56
libqxp::QXPBlockParser::m_input
const std::shared_ptr< librevenge::RVNGInputStream > m_input
Definition: QXPBlockParser.h:33
libqxp::QXPBlockParser
Definition: QXPBlockParser.h:20
libqxp::QXPBlockParser::be
const bool be
Definition: QXPBlockParser.h:35
libqxp::QXPBlockParser::m_header
const std::shared_ptr< QXPHeader > m_header
Definition: QXPBlockParser.h:34
libqxp::QXPBlockParser::getChain
std::shared_ptr< librevenge::RVNGInputStream > getChain(const uint32_t index)
Definition: QXPBlockParser.cpp:69
libqxp::QXP_31_MAC
Definition: QXPHeader.h:26
libqxp::QXPBlockParser::QXPBlockParser
QXPBlockParser(const QXPBlockParser &other)=delete
libqxp::QXPBlockParser::m_length
const unsigned long m_length
Definition: QXPBlockParser.h:37
libqxp::QXPBlockParser::m_lastBlock
const uint32_t m_lastBlock
Definition: QXPBlockParser.h:39
QXPHeader.h
libqxp::getRemainingLength
unsigned long getRemainingLength(librevenge::RVNGInputStream *const input)
Definition: libqxp_utils.cpp:259