3
* SQSH stream class definition
4
* Copyright (C) 2005 Christopher Han <xiphux@gmail.com>
6
* This file is part of hpiutil2.
8
* hpiutil2 is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* hpiutil2 is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with hpiutil2; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
#ifndef HPIUTIL2_SQSHSTREAM_H
24
#define HPIUTIL2_SQSHSTREAM_H
27
#include "substream.h"
33
#define SQSH_MAGIC 0x48535153
34
#define SQSH_HEADER 19
43
boost::uint8_t encrypt;
44
boost::uint8_t compress;
45
boost::uint32_t position;
46
sqshstream(substream &ss);
48
boost::uint8_t read();
49
boost::uint32_t read(boost::uint8_t *buf);
50
boost::uint32_t read(boost::uint8_t *buf, const boost::uint32_t off, const boost::uint32_t len);
51
boost::uint32_t readall(boost::uint8_t *buf);
52
boost::uint32_t readint();
55
boost::uint32_t decompresszlib(boost::uint8_t *src, boost::uint8_t *dest, const boost::uint32_t srcsize, const boost::uint32_t destsize);
56
boost::uint32_t decompresslz77(boost::uint8_t *src, boost::uint8_t *dest, const boost::uint32_t srcsize, const boost::uint32_t destsize);
58
std::istringstream *fullstream;
60
boost::uint32_t compressedsize;
61
boost::uint32_t fullsize;
62
boost::uint32_t checksum;
67
#endif /* HPIUTIL2_SQSHSTREAM_H */