QXPBlockParser.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libqxp project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef QXPBLOCKPARSER_H_INCLUDED
00011 #define QXPBLOCKPARSER_H_INCLUDED
00012 
00013 #include "libqxp_utils.h"
00014 
00015 namespace libqxp
00016 {
00017 
00018 class QXPHeader;
00019 
00020 class QXPBlockParser
00021 {
00022   // disable copying
00023   QXPBlockParser(const QXPBlockParser &other) = delete;
00024   QXPBlockParser &operator=(const QXPBlockParser &other) = delete;
00025 
00026 public:
00027   QXPBlockParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, const std::shared_ptr<QXPHeader> &header);
00028 
00029   std::shared_ptr<librevenge::RVNGInputStream> getBlock(const uint32_t index);
00030   std::shared_ptr<librevenge::RVNGInputStream> getChain(const uint32_t index);
00031 
00032 private:
00033   const std::shared_ptr<librevenge::RVNGInputStream> m_input;
00034   const std::shared_ptr<QXPHeader> m_header;
00035   const bool be; // big endian
00036 
00037   const unsigned long m_length;
00038   const uint32_t m_blockLength;
00039   const uint32_t m_lastBlock;
00040 };
00041 
00042 }
00043 
00044 #endif // QXPBLOCKPARSER_H_INCLUDED
00045 
00046 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */