Orcus
include
orcus
zip_archive_stream.hpp
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
*/
7
8
#ifndef __ORCUS_ZIP_ARCHIVE_STREAM_HPP__
9
#define __ORCUS_ZIP_ARCHIVE_STREAM_HPP__
10
11
#include "env.hpp"
12
#include <cstdlib>
13
#include <cstdio>
14
15
namespace
orcus {
16
17
class
ORCUS_PSR_DLLPUBLIC
zip_archive_stream
18
{
19
public
:
20
virtual
~
zip_archive_stream
();
21
22
virtual
size_t
size()
const
= 0;
23
virtual
size_t
tell()
const
= 0;
24
virtual
void
seek(
size_t
pos) = 0;
25
virtual
void
read(
unsigned
char
* buffer,
size_t
length)
const
= 0;
26
};
27
32
class
ORCUS_PSR_DLLPUBLIC
zip_archive_stream_fd
:
public
zip_archive_stream
33
{
34
FILE* m_stream;
35
36
public
:
37
zip_archive_stream_fd
() =
delete
;
38
zip_archive_stream_fd
(
const
char
* filepath);
39
virtual
~
zip_archive_stream_fd
();
40
41
virtual
size_t
size()
const
;
42
virtual
size_t
tell()
const
;
43
virtual
void
seek(
size_t
pos);
44
virtual
void
read(
unsigned
char
* buffer,
size_t
length)
const
;
45
};
46
50
class
ORCUS_PSR_DLLPUBLIC
zip_archive_stream_blob
:
public
zip_archive_stream
51
{
52
const
unsigned
char
* m_blob;
53
const
unsigned
char
* m_cur;
54
size_t
m_size;
55
56
public
:
57
zip_archive_stream_blob
() =
delete
;
58
zip_archive_stream_blob
(
const
unsigned
char
* blob,
size_t
size);
59
virtual
~
zip_archive_stream_blob
();
60
61
virtual
size_t
size()
const
;
62
virtual
size_t
tell()
const
;
63
virtual
void
seek(
size_t
pos);
64
virtual
void
read(
unsigned
char
* buffer,
size_t
length)
const
;
65
};
66
67
}
68
69
#endif
70
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::zip_archive_stream_blob
Definition:
zip_archive_stream.hpp:50
orcus::zip_archive_stream_fd
Definition:
zip_archive_stream.hpp:32
orcus::zip_archive_stream
Definition:
zip_archive_stream.hpp:17
Generated on Thu Jul 8 2021 09:19:44 for Orcus by
1.8.17